<head>
    
    <!-- styles for demo purpose -->
    
    <!-- start checkboxTree configuration -->
	<script type="text/javascript" src="<?php echo base_url();?>js/cb/library/jquery-1.4.4.js"></script>
    	
    <script type="text/javascript" src="<?php echo base_url();?>js/cb/library/jquery-ui-1.8.12.custom/js/jquery-ui-1.8.12.custom.min.js"></script>
    <link rel="stylesheet" type="text/css"
          href="<?php echo base_url();?>js/cb/library/jquery-ui-1.8.12.custom/css/smoothness/jquery-ui-1.8.12.custom.css"/>

    <script type="text/javascript" src="<?php echo base_url();?>js/cb/jquery.checkboxtree.js"></script>
    <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>js/cb/jquery.checkboxtree.css"/>
    <!-- end checkboxTree configuration -->

    <script type="text/javascript" src="<?php echo base_url();?>js/cb/library/jquery.cookie.js"></script>
    <script type="text/javascript">
        //<!--
        $(document).ready(function() {            
            $('.jquery').each(function() {
                eval($(this).html());
            });
            $('.button').button();
			$('#tree1').checkboxTree({
				collapseImage: '<?php echo base_url();?>js/cb/images/minus.png',
				expandImage: '<?php echo base_url();?>js/cb/images/plus.png'
			});
			$('#tree2').checkboxTree({
				collapseImage: '<?php echo base_url();?>js/cb/images/minus.png',
				expandImage: '<?php echo base_url();?>js/cb/images/plus.png'
			});
			$('#tree3').checkboxTree({
				collapseImage: '<?php echo base_url();?>js/cb/images/minus.png',
				expandImage: '<?php echo base_url();?>js/cb/images/plus.png'
			});
			$('#tree4').checkboxTree({
				collapseImage: '<?php echo base_url();?>js/cb/images/minus.png',
				expandImage: '<?php echo base_url();?>js/cb/images/plus.png'
			});
        });
		
        //-->
    </script>
</head>


<div class="post-title"><h2><a href="<?php echo current_url();?>"><?php echo $title; ?></a></h2></div>

<div class="post-body">

<?php
	echo form_open('user/'.$form_act, 'id="user_form"');

	echo "<div id='error' class='error-message' ";

	if($this->session->userdata('ERRMSG_ARR'))
	{
		echo ">";
		echo $this->session->userdata('ERRMSG_ARR');
		$this->session->unset_userdata('ERRMSG_ARR');
	}
	else
	{
		echo "style='display:none'>";
	}
	
	echo "</div>";

	if($this->session->userdata('SUCCESSMSG'))
	{
		echo "<div class='success'>".$this->session->userdata('SUCCESSMSG')."</div>";
		$this->session->unset_userdata('SUCCESSMSG');
	}

	$data['class'] = 'input';
	if ($act == 'akses') $data['disabled'] = TRUE;
?>

	<table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
		<tr>
			<th><?php echo form_label('Nama Depan *','fname'); ?></th>
			<td>
				<?php 
					$data['name'] = $data['id'] = 'fname';
					$data['value'] = (set_value('fname')) ? set_value('fname') : $user_data['nama_depan'];
					$data['title'] = "Nama Depan tidak boleh kosong dan harus diisi dengan huruf";
					echo form_input($data);
				?>
			</td>
		</tr>
		<tr>
			<th><?php echo form_label('Nama Belakang *','lname'); ?></th>
			<td>
				<?php 
					$data['name'] = $data['id'] = 'lname';
					$data['value'] = (set_value('lname')) ? set_value('lname') : $user_data['nama_belakang'];
					$data['title'] = "Nama Belakang tidak boleh kosong dan harus diisi dengan huruf";
					echo form_input($data);
				?>
			</td>			
		</tr>
		<tr>
			<th><?php echo form_label('Username *','username'); ?></th>
			<td>
				<?php 
					$data['name'] = $data['id'] = 'username';
					$data['value'] = (set_value('username')) ? set_value('username') : $user_data['username'];
					$data['title'] = "Username tidak boleh kosong dan harus diisi dengan huruf, angka, spasi, atau garis bawah";
					echo form_input($data);
				?>
			</td>
		</tr>
	</table>
  
	<div class="buttons">
		<?php 
		/*
			if($act!='view')
			{ 
				echo form_submit('simpan', 'Simpan', "id = 'button-save'" );
				echo form_reset('reset','Reset', "id = 'button-reset'" );
				if($this->session->userdata('ADMIN'))
					echo form_button(array('id' => 'button-cancel', 'content' => 'Batal', 'onClick' => "location.href='".site_url()."user'" ));
			}
			else
			{
				echo form_button(array('id' => 'button-cancel', 'content' => 'Kembali', 'onClick' => "location.href='".site_url()."user'" ));
			}
			*/
		?>
	</div>

<?php echo form_close(); ?>
</div>

<?php 
$idx = $this->uri->segment(3);
//echo "oi !!! : " . $user_data['role']; 
//echo "<br>test uri 3 : " . $idx; 
?>

<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<?php 
  $idx = $this->uri->segment(3); 
  
  if($idx == 1){
	if(isset($_POST['submit'])) {   	
		if (isset($_POST['mr1']))
		{
			$read = $_POST['mr1'];
			if($read == 'on'){
				$n1 = 1;
			}			
		}else{
			$n1 = 0;
		}		
		if (isset($_POST['mr2']))
		{
			$read = $_POST['mr2'];
			if($read == 'on'){
				$n2 = 1;
			}			
		}else{
			$n2 = 0;
		}
		if (isset($_POST['mr3']))
		{
			$read = $_POST['mr3'];
			if($read == 'on'){
				$n3 = 1;
			}			
		}else{
			$n3 = 0;
		}
		if (isset($_POST['mr4']))
		{
			$read = $_POST['mr4'];
			if($read == 'on'){
				$n4 = 1;
			}			
		}else{
			$n4 = 0;
		}
		if (isset($_POST['mr5']))
		{
			$read = $_POST['mr5'];
			if($read == 'on'){
				$n5 = 1;
			}			
		}else{
			$n5 = 0;
		}
		if (isset($_POST['mr6']))
		{
			$read = $_POST['mr6'];
			if($read == 'on'){
				$n6 = 1;
			}			
		}else{
			$n6 = 0;
		}
		if (isset($_POST['mr7']))
		{
			$read = $_POST['mr7'];
			if($read == 'on'){
				$n7 = 1;
			}
		}else{
			$n7 = 0;
		}
		if (isset($_POST['mr8']))
		{
			$read = $_POST['mr8'];
			if($read == 'on'){
				$n8 = 1;
			}
		}else{
			$n8 = 0;
		}
		if (isset($_POST['mr9']))
		{
			$read = $_POST['mr9'];
			if($read == 'on'){
				$n9 = 1;
			}
		}else{
			$n9 = 0;
		}
		if (isset($_POST['mr10']))
		{
			$read = $_POST['mr10'];
			if($read == 'on'){
				$n10 = 1;
			}
		}else{
			$n10 = 0;
		}
		if (isset($_POST['mr11']))
		{
			$read = $_POST['mr11'];
			if($read == 'on'){
				$n11 = 1;
			}
		}else{
			$n11 = 0;
		}
				
		mysql_query("UPDATE mainmenu SET admin = $n1 WHERE urutan = 1");
		mysql_query("UPDATE mainmenu SET admin = $n2 WHERE urutan = 2");
		mysql_query("UPDATE mainmenu SET admin = $n3 WHERE urutan = 3");
		mysql_query("UPDATE mainmenu SET admin = $n4 WHERE urutan = 4");
		mysql_query("UPDATE mainmenu SET admin = $n5 WHERE urutan = 5");
		mysql_query("UPDATE mainmenu SET admin = $n6 WHERE urutan = 6");
		mysql_query("UPDATE mainmenu SET admin = $n7 WHERE urutan = 7");
		mysql_query("UPDATE mainmenu SET admin = $n8 WHERE urutan = 8");
		mysql_query("UPDATE mainmenu SET admin = $n9 WHERE urutan = 9");
		
		if (isset($_POST['sr1']))
		{
			$read = $_POST['sr1'];
			if($read == 'on'){
				$sn1 = 1;
			}
		}else{
			$sn1 = 0;
		}
		if (isset($_POST['sr2']))
		{
			$read = $_POST['sr2'];
			if($read == 'on'){
				$sn2 = 1;
			}
		}else{
			$sn2 = 0;
		}
		if (isset($_POST['sr3']))
		{
			$read = $_POST['sr3'];
			if($read == 'on'){
				$sn3 = 1;
			}
		}else{
			$sn3 = 0;
		}
		if (isset($_POST['sr4']))
		{
			$read = $_POST['sr4'];
			if($read == 'on'){
				$sn4 = 1;
			}
		}else{
			$sn4 = 0;
		}
		if (isset($_POST['sr5']))
		{
			$read = $_POST['sr5'];
			if($read == 'on'){
				$sn5 = 1;
			}
		}else{
			$sn5 = 0;
		}
		if (isset($_POST['sr6']))
		{
			$read = $_POST['sr6'];
			if($read == 'on'){
				$sn6 = 1;
			}
		}else{
			$sn6 = 0;
		}
		if (isset($_POST['sr7']))
		{
			$read = $_POST['sr7'];
			if($read == 'on'){
				$sn7 = 1;
			}
		}else{
			$sn7 = 0;
		}
		if (isset($_POST['sr8']))
		{
			$read = $_POST['sr8'];
			if($read == 'on'){
				$sn8 = 1;
			}
		}else{
			$sn8 = 0;
		}
		if (isset($_POST['sr9']))
		{
			$read = $_POST['sr9'];
			if($read == 'on'){
				$sn9 = 1;
			}
		}else{
			$sn9 = 0;
		}
		if (isset($_POST['sr10']))
		{
			$read = $_POST['sr10'];
			if($read == 'on'){
				$sn10 = 1;
			}
		}else{
			$sn10 = 0;
		}
		if (isset($_POST['sr11']))
		{
			$read = $_POST['sr11'];
			if($read == 'on'){
				$sn11 = 1;
			}
		}else{
			$sn11 = 0;
		}
		if (isset($_POST['sr12']))
		{
			$read = $_POST['sr12'];
			if($read == 'on'){
				$sn12 = 1;
			}
		}else{
			$sn12 = 0;
		}
		if (isset($_POST['sr13']))
		{
			$read = $_POST['sr13'];
			if($read == 'on'){
				$sn13 = 1;
			}
		}else{
			$sn13 = 0;
		}
		if (isset($_POST['sr14']))
		{
			$read = $_POST['sr14'];
			if($read == 'on'){
				$sn14 = 1;
			}
		}else{
			$sn14 = 0;
		}
		if (isset($_POST['sr15']))
		{
			$read = $_POST['sr15'];
			if($read == 'on'){
				$sn15 = 1;
			}
		}else{
			$sn15 = 0;
		}
		if (isset($_POST['sr16']))
		{
			$read = $_POST['sr16'];
			if($read == 'on'){
				$sn16 = 1;
			}
		}else{
			$sn16 = 0;
		}
		if (isset($_POST['sr17']))
		{
			$read = $_POST['sr17'];
			if($read == 'on'){
				$sn17 = 1;
			}
		}else{
			$sn17 = 0;
		}
		if (isset($_POST['sr18']))
		{
			$read = $_POST['sr18'];
			if($read == 'on'){
				$sn18 = 1;
			}
		}else{
			$sn18 = 0;
		}
		if (isset($_POST['sr19']))
		{
			$read = $_POST['sr19'];
			if($read == 'on'){
				$sn19 = 1;
			}
		}else{
			$sn19 = 0;
		}
		if (isset($_POST['sr20']))
		{
			$read = $_POST['sr20'];
			if($read == 'on'){
				$sn20 = 1;
			}
		}else{
			$sn20 = 0;
		}
		if (isset($_POST['sr21']))
		{
			$read = $_POST['sr21'];
			if($read == 'on'){
				$sn21 = 1;
			}
		}else{
			$sn21 = 0;
		}
		if (isset($_POST['sr22']))
		{
			$read = $_POST['sr22'];
			if($read == 'on'){
				$sn22 = 1;
			}
		}else{
			$sn22 = 0;
		}
		if (isset($_POST['sr23']))
		{
			$read = $_POST['sr23'];
			if($read == 'on'){
				$sn23 = 1;
			}
		}else{
			$sn23 = 0;
		}
		if (isset($_POST['sr24']))
		{
			$read = $_POST['sr24'];
			if($read == 'on'){
				$sn24 = 1;
			}
		}else{
			$sn24 = 0;
		}
		if (isset($_POST['sr25']))
		{
			$read = $_POST['sr25'];
			if($read == 'on'){
				$sn25 = 1;
			}
		}else{
			$sn25 = 0;
		}
		if (isset($_POST['sr26']))
		{
			$read = $_POST['sr26'];
			if($read == 'on'){
				$sn26 = 1;
			}
		}else{
			$sn26 = 0;
		}
		if (isset($_POST['sr27']))
		{
			$read = $_POST['sr27'];
			if($read == 'on'){
				$sn27 = 1;
			}
		}else{
			$sn27 = 0;
		}
		if (isset($_POST['sr28']))
		{
			$read = $_POST['sr28'];
			if($read == 'on'){
				$sn28 = 1;
			}
		}else{
			$sn28 = 0;
		}
		if (isset($_POST['sr29']))
		{
			$read = $_POST['sr29'];
			if($read == 'on'){
				$sn29 = 1;
			}
		}else{
			$sn29 = 0;
		}
		if (isset($_POST['sr30']))
		{
			$read = $_POST['sr30'];
			if($read == 'on'){
				$sn30 = 1;
			}
		}else{
			$sn30 = 0;
		}
		if (isset($_POST['sr31']))
		{
			$read = $_POST['sr31'];
			if($read == 'on'){
				$sn31 = 1;
			}
		}else{
			$sn31 = 0;
		}
		if (isset($_POST['sr32']))
		{
			$read = $_POST['sr32'];
			if($read == 'on'){
				$sn32 = 1;
			}
		}else{
			$sn32 = 0;
		}
		if (isset($_POST['sr33']))
		{
			$read = $_POST['sr33'];
			if($read == 'on'){
				$sn33 = 1;
			}
		}else{
			$sn33 = 0;
		}
		if (isset($_POST['sr34']))
		{
			$read = $_POST['sr34'];
			if($read == 'on'){
				$sn34 = 1;
			}
		}else{
			$sn34 = 0;
		}
		if (isset($_POST['sr35']))
		{
			$read = $_POST['sr35'];
			if($read == 'on'){
				$sn35 = 1;
			}
		}else{
			$sn35 = 0;
		}
		if (isset($_POST['sr36']))
		{
			$read = $_POST['sr36'];
			if($read == 'on'){
				$sn36 = 1;
			}
		}else{
			$sn36 = 0;
		}
		if (isset($_POST['sr37']))
		{
			$read = $_POST['sr37'];
			if($read == 'on'){
				$sn37 = 1;
			}
		}else{
			$sn37 = 0;
		}
		if (isset($_POST['sr38']))
		{
			$read = $_POST['sr38'];
			if($read == 'on'){
				$sn38 = 1;
			}
		}else{
			$sn38 = 0;
		}
		if (isset($_POST['sr39']))
		{
			$read = $_POST['sr39'];
			if($read == 'on'){
				$sn39 = 1;
			}
		}else{
			$sn39 = 0;
		}
		if (isset($_POST['sr40']))
		{
			$read = $_POST['sr40'];
			if($read == 'on'){
				$sn40 = 1;
			}
		}else{
			$sn40 = 0;
		}
		if (isset($_POST['sr41']))
		{
			$read = $_POST['sr41'];
			if($read == 'on'){
				$sn41 = 1;
			}
		}else{
			$sn41 = 0;
		}
		if (isset($_POST['sr42']))
		{
			$read = $_POST['sr42'];
			if($read == 'on'){
				$sn42 = 1;
			}
		}else{
			$sn42 = 0;
		}
		if (isset($_POST['sr43']))
		{
			$read = $_POST['sr43'];
			if($read == 'on'){
				$sn43 = 1;
			}
		}else{
			$sn43 = 0;
		}
		if (isset($_POST['sr44']))
		{
			$read = $_POST['sr44'];
			if($read == 'on'){
				$sn44 = 1;
			}
		}else{
			$sn44 = 0;
		}
		
		mysql_query("UPDATE submenu SET admin = $sn1 WHERE urutan = 1");
		mysql_query("UPDATE submenu SET admin = $sn2 WHERE urutan = 2");
		mysql_query("UPDATE submenu SET admin = $sn3 WHERE urutan = 3");
		mysql_query("UPDATE submenu SET admin = $sn4 WHERE urutan = 4");
		mysql_query("UPDATE submenu SET admin = $sn5 WHERE urutan = 5");
		mysql_query("UPDATE submenu SET admin = $sn6 WHERE urutan = 6");
		mysql_query("UPDATE submenu SET admin = $sn7 WHERE urutan = 7");
		mysql_query("UPDATE submenu SET admin = $sn8 WHERE urutan = 8");
		mysql_query("UPDATE submenu SET admin = $sn9 WHERE urutan = 9");
		mysql_query("UPDATE submenu SET admin = $sn10 WHERE urutan = 10");
		mysql_query("UPDATE submenu SET admin = $sn11 WHERE urutan = 11");
		mysql_query("UPDATE submenu SET admin = $sn12 WHERE urutan = 12");
		mysql_query("UPDATE submenu SET admin = $sn13 WHERE urutan = 13");
		mysql_query("UPDATE submenu SET admin = $sn14 WHERE urutan = 14");
		mysql_query("UPDATE submenu SET admin = $sn15 WHERE urutan = 15");
		mysql_query("UPDATE submenu SET admin = $sn16 WHERE urutan = 16");
		mysql_query("UPDATE submenu SET admin = $sn17 WHERE urutan = 17");
		mysql_query("UPDATE submenu SET admin = $sn18 WHERE urutan = 18");
		mysql_query("UPDATE submenu SET admin = $sn19 WHERE urutan = 19");
		mysql_query("UPDATE submenu SET admin = $sn20 WHERE urutan = 20");
		mysql_query("UPDATE submenu SET admin = $sn21 WHERE urutan = 21");
		mysql_query("UPDATE submenu SET admin = $sn22 WHERE urutan = 22");
		mysql_query("UPDATE submenu SET admin = $sn23 WHERE urutan = 23");
		mysql_query("UPDATE submenu SET admin = $sn24 WHERE urutan = 24");
		mysql_query("UPDATE submenu SET admin = $sn25 WHERE urutan = 25");
		mysql_query("UPDATE submenu SET admin = $sn26 WHERE urutan = 26");
		mysql_query("UPDATE submenu SET admin = $sn27 WHERE urutan = 27");
		mysql_query("UPDATE submenu SET admin = $sn28 WHERE urutan = 28");
		mysql_query("UPDATE submenu SET admin = $sn29 WHERE urutan = 29");
		mysql_query("UPDATE submenu SET admin = $sn30 WHERE urutan = 30");
		mysql_query("UPDATE submenu SET admin = $sn31 WHERE urutan = 31");
		mysql_query("UPDATE submenu SET admin = $sn32 WHERE urutan = 32");
		mysql_query("UPDATE submenu SET admin = $sn33 WHERE urutan = 33");
		mysql_query("UPDATE submenu SET admin = $sn34 WHERE urutan = 34");
		mysql_query("UPDATE submenu SET admin = $sn35 WHERE urutan = 35");
		mysql_query("UPDATE submenu SET admin = $sn36 WHERE urutan = 36");
		mysql_query("UPDATE submenu SET admin = $sn37 WHERE urutan = 37");
		mysql_query("UPDATE submenu SET admin = $sn38 WHERE urutan = 38");
		mysql_query("UPDATE submenu SET admin = $sn39 WHERE urutan = 39");
		mysql_query("UPDATE submenu SET admin = $sn40 WHERE urutan = 40");
		mysql_query("UPDATE submenu SET admin = $sn41 WHERE urutan = 41");
		mysql_query("UPDATE submenu SET admin = $sn42 WHERE urutan = 42");
		mysql_query("UPDATE submenu SET admin = $sn43 WHERE urutan = 43");
		//mysql_query("UPDATE submenu SET admin = $sn44 WHERE urutan = 44");
					
		echo '<meta http-equiv="refresh" content="0">';
	}
  
	  $ms1 = "SELECT * FROM mainmenu WHERE urutan = 1";
	  $mres1 = mysql_query($ms1);
	  $mr1 = mysql_fetch_array($mres1);
	  $_mck1 = ($mr1['admin'] == 0) ? '' : 'checked';
	  
	  $ms2 = "SELECT * FROM mainmenu WHERE urutan = 2";
	  $mres2 = mysql_query($ms2);
	  $mr2 = mysql_fetch_array($mres2);
	  $_mck2 = ($mr2['admin'] == 0) ? '' : 'checked';
	  
	  $ms3 = "SELECT * FROM mainmenu WHERE urutan = 3";
	  $mres3 = mysql_query($ms3);
	  $mr3 = mysql_fetch_array($mres3);
	  $_mck3 = ($mr3['admin'] == 0) ? '' : 'checked';
	  
	  $ms4 = "SELECT * FROM mainmenu WHERE urutan = 4";
	  $mres4 = mysql_query($ms4);
	  $mr4 = mysql_fetch_array($mres4);
	  $_mck4 = ($mr4['admin'] == 0) ? '' : 'checked';
	  
	  $ms5 = "SELECT * FROM mainmenu WHERE urutan = 5";
	  $mres5 = mysql_query($ms5);
	  $mr5 = mysql_fetch_array($mres5);
	  $_mck5 = ($mr5['admin'] == 0) ? '' : 'checked';
	  
	  $ms6 = "SELECT * FROM mainmenu WHERE urutan = 6";
	  $mres6 = mysql_query($ms6);
	  $mr6 = mysql_fetch_array($mres6);
	  $_mck6 = ($mr6['admin'] == 0) ? '' : 'checked';
	  
	  $ms7 = "SELECT * FROM mainmenu WHERE urutan = 7";
	  $mres7 = mysql_query($ms7);
	  $mr7 = mysql_fetch_array($mres7);
	  $_mck7 = ($mr7['admin'] == 0) ? '' : 'checked';
	  
	  $ms8 = "SELECT * FROM mainmenu WHERE urutan = 8";
	  $mres8 = mysql_query($ms8);
	  $mr8 = mysql_fetch_array($mres8);
	  $_mck8 = ($mr8['admin'] == 0) ? '' : 'checked';
	  
	  $ms9 = "SELECT * FROM mainmenu WHERE urutan = 9";
	  $mres9 = mysql_query($ms9);
	  $mr9 = mysql_fetch_array($mres9);
	  $_mck9 = ($mr9['admin'] == 0) ? '' : 'checked';
	  
	  $ms10 = "SELECT * FROM mainmenu WHERE urutan = 10";
	  $mres10 = mysql_query($ms10);
	  $mr10 = mysql_fetch_array($mres10);
	  $_mck10 = ($mr10['admin'] == 0) ? '' : 'checked';
	  
	  $ms11 = "SELECT * FROM mainmenu WHERE urutan = 11";
	  $mres11 = mysql_query($ms11);
	  $mr11 = mysql_fetch_array($mres11);
	  $_mck11 = ($mr11['admin'] == 0) ? '' : 'checked';
	  
	  $ss1 = "SELECT * FROM submenu WHERE urutan = 1";
	  $sres1 = mysql_query($ss1);
	  $sr1 = mysql_fetch_array($sres1);
	  $_sck1 = ($sr1['admin'] == 0) ? '' : 'checked';
	  
	  $ss2 = "SELECT * FROM mainmenu WHERE urutan = 2";
	  $sres2 = mysql_query($ss2);
	  $sr2 = mysql_fetch_array($sres2);
	  $_sck2 = ($sr2['admin'] == 0) ? '' : 'checked';
	  
	  $ss3 = "SELECT * FROM mainmenu WHERE urutan = 3";
	  $sres3 = mysql_query($ss3);
	  $sr3 = mysql_fetch_array($sres3);
	  $_sck3 = ($sr3['admin'] == 0) ? '' : 'checked';
	  
	  $ss4 = "SELECT * FROM mainmenu WHERE urutan = 4";
	  $sres4 = mysql_query($ss4);
	  $sr4 = mysql_fetch_array($sres4);
	  $_sck4 = ($sr4['admin'] == 0) ? '' : 'checked';
	  
	  $ss5 = "SELECT * FROM mainmenu WHERE urutan = 5";
	  $sres5 = mysql_query($ss5);
	  $sr5 = mysql_fetch_array($sres5);
	  $_sck5 = ($sr5['admin'] == 0) ? '' : 'checked';
	  
	  $ss6 = "SELECT * FROM mainmenu WHERE urutan = 6";
	  $sres6 = mysql_query($ss6);
	  $sr6 = mysql_fetch_array($sres6);
	  $_sck6 = ($sr6['admin'] == 0) ? '' : 'checked';
	  
	  $ss7 = "SELECT * FROM mainmenu WHERE urutan = 7";
	  $sres7 = mysql_query($ss7);
	  $sr7 = mysql_fetch_array($sres7);
	  $_sck7 = ($sr7['admin'] == 0) ? '' : 'checked';
	  
	  $ss8 = "SELECT * FROM mainmenu WHERE urutan = 8";
	  $sres8 = mysql_query($ss8);
	  $sr8 = mysql_fetch_array($sres8);
	  $_sck8 = ($sr8['admin'] == 0) ? '' : 'checked';
	  
	  $ss9 = "SELECT * FROM mainmenu WHERE urutan = 9";
	  $sres9 = mysql_query($ss9);
	  $sr9 = mysql_fetch_array($sres9);
	  $_sck9 = ($sr9['admin'] == 0) ? '' : 'checked';
	  
	  $ss10 = "SELECT * FROM mainmenu WHERE urutan = 10";
	  $sres10 = mysql_query($ss10);
	  $sr10 = mysql_fetch_array($sres10);
	  $_sck10 = ($sr10['admin'] == 0) ? '' : 'checked';
	  
	  $ss11 = "SELECT * FROM mainmenu WHERE urutan = 11";
	  $sres11 = mysql_query($ss11);
	  $sr11 = mysql_fetch_array($sres11);
	  $_sck11 = ($sr11['admin'] == 0) ? '' : 'checked';
	  
	  $ss2 = "SELECT * FROM submenu WHERE urutan = 2";
	  $sres2 = mysql_query($ss2);
	  $sr2 = mysql_fetch_array($sres2);
	  $_sck2 = ($sr2['admin'] == 0) ? '' : 'checked';
	  
	  $ss3 = "SELECT * FROM submenu WHERE urutan = 3";
	  $sres3 = mysql_query($ss3);
	  $sr3 = mysql_fetch_array($sres3);
	  $_sck3 = ($sr3['admin'] == 0) ? '' : 'checked';
	  
	  $ss4 = "SELECT * FROM submenu WHERE urutan = 4";
	  $sres4 = mysql_query($ss4);
	  $sr4 = mysql_fetch_array($sres4);
	  $_sck4 = ($sr4['admin'] == 0) ? '' : 'checked';
	  
	  $ss5 = "SELECT * FROM submenu WHERE urutan = 5";
	  $sres5 = mysql_query($ss5);
	  $sr5 = mysql_fetch_array($sres5);
	  $_sck5 = ($sr5['admin'] == 0) ? '' : 'checked';
	  
	  $ss6 = "SELECT * FROM submenu WHERE urutan = 6";
	  $sres6 = mysql_query($ss6);
	  $sr6 = mysql_fetch_array($sres6);
	  $_sck6 = ($sr6['admin'] == 0) ? '' : 'checked';
	  
	  $ss7 = "SELECT * FROM submenu WHERE urutan = 7";
	  $sres7 = mysql_query($ss7);
	  $sr7 = mysql_fetch_array($sres7);
	  $_sck7 = ($sr7['admin'] == 0) ? '' : 'checked';
	  
	  $ss8 = "SELECT * FROM submenu WHERE urutan = 8";
	  $sres8 = mysql_query($ss8);
	  $sr8 = mysql_fetch_array($sres8);
	  $_sck8 = ($sr8['admin'] == 0) ? '' : 'checked';
	  
	  $ss9 = "SELECT * FROM submenu WHERE urutan = 9";
	  $sres9 = mysql_query($ss9);
	  $sr9 = mysql_fetch_array($sres9);
	  $_sck9 = ($sr9['admin'] == 0) ? '' : 'checked';
	  
	  $ss10 = "SELECT * FROM submenu WHERE urutan = 10";
	  $sres10 = mysql_query($ss10);
	  $sr10 = mysql_fetch_array($sres10);
	  $_sck10 = ($sr10['admin'] == 0) ? '' : 'checked';
	  
	  $ss11 = "SELECT * FROM submenu WHERE urutan = 11";
	  $sres11 = mysql_query($ss11);
	  $sr11 = mysql_fetch_array($sres11);
	  $_sck11 = ($sr11['admin'] == 0) ? '' : 'checked';
	  
	  $ss12 = "SELECT * FROM submenu WHERE urutan = 12";
	  $sres12 = mysql_query($ss12);
	  $sr12 = mysql_fetch_array($sres12);
	  $_sck12 = ($sr12['admin'] == 0) ? '' : 'checked';
	  
	  $ss13 = "SELECT * FROM submenu WHERE urutan = 13";
	  $sres13 = mysql_query($ss13);
	  $sr13 = mysql_fetch_array($sres13);
	  $_sck13 = ($sr13['admin'] == 0) ? '' : 'checked';
	  
	  $ss14 = "SELECT * FROM submenu WHERE urutan = 14";
	  $sres14 = mysql_query($ss14);
	  $sr14 = mysql_fetch_array($sres14);
	  $_sck14 = ($sr14['admin'] == 0) ? '' : 'checked';
	  
	  $ss15 = "SELECT * FROM submenu WHERE urutan = 15";
	  $sres15 = mysql_query($ss15);
	  $sr15 = mysql_fetch_array($sres15);
	  $_sck15 = ($sr15['admin'] == 0) ? '' : 'checked';
	  
	  $ss16 = "SELECT * FROM submenu WHERE urutan = 16";
	  $sres16 = mysql_query($ss16);
	  $sr16 = mysql_fetch_array($sres16);
	  $_sck16 = ($sr16['admin'] == 0) ? '' : 'checked';
	  
	  $ss17 = "SELECT * FROM submenu WHERE urutan = 17";
	  $sres17 = mysql_query($ss17);
	  $sr17 = mysql_fetch_array($sres17);
	  $_sck17 = ($sr17['admin'] == 0) ? '' : 'checked';
	  
	  $ss18 = "SELECT * FROM submenu WHERE urutan = 18";
	  $sres18 = mysql_query($ss18);
	  $sr18 = mysql_fetch_array($sres18);
	  $_sck18 = ($sr18['admin'] == 0) ? '' : 'checked';
	  
	  $ss19 = "SELECT * FROM submenu WHERE urutan = 19";
	  $sres19 = mysql_query($ss19);
	  $sr19 = mysql_fetch_array($sres19);
	  $_sck19 = ($sr19['admin'] == 0) ? '' : 'checked';
	  
	  $ss20 = "SELECT * FROM submenu WHERE urutan = 20";
	  $sres20 = mysql_query($ss20);
	  $sr20 = mysql_fetch_array($sres20);
	  $_sck20 = ($sr20['admin'] == 0) ? '' : 'checked';
	  
	  $ss21 = "SELECT * FROM submenu WHERE urutan = 21";
	  $sres21 = mysql_query($ss21);
	  $sr21 = mysql_fetch_array($sres21);
	  $_sck21 = ($sr21['admin'] == 0) ? '' : 'checked';
	  
	  $ss22 = "SELECT * FROM submenu WHERE urutan = 22";
	  $sres22 = mysql_query($ss22);
	  $sr22 = mysql_fetch_array($sres22);
	  $_sck22 = ($sr22['admin'] == 0) ? '' : 'checked';
	  
	  $ss23 = "SELECT * FROM submenu WHERE urutan = 23";
	  $sres23 = mysql_query($ss23);
	  $sr23 = mysql_fetch_array($sres23);
	  $_sck23 = ($sr23['admin'] == 0) ? '' : 'checked';
	  
	  $ss24 = "SELECT * FROM submenu WHERE urutan = 24";
	  $sres24 = mysql_query($ss24);
	  $sr24 = mysql_fetch_array($sres24);
	  $_sck24 = ($sr24['admin'] == 0) ? '' : 'checked';
	  
	  $ss25 = "SELECT * FROM submenu WHERE urutan = 25";
	  $sres25 = mysql_query($ss25);
	  $sr25 = mysql_fetch_array($sres25);
	  $_sck25 = ($sr25['admin'] == 0) ? '' : 'checked';
	  
	  $ss26 = "SELECT * FROM submenu WHERE urutan = 26";
	  $sres26 = mysql_query($ss26);
	  $sr26 = mysql_fetch_array($sres26);
	  $_sck26 = ($sr26['admin'] == 0) ? '' : 'checked';
	  
	  $ss27 = "SELECT * FROM submenu WHERE urutan = 27";
	  $sres27 = mysql_query($ss27);
	  $sr27 = mysql_fetch_array($sres27);
	  $_sck27 = ($sr27['admin'] == 0) ? '' : 'checked';
	  
	  $ss28 = "SELECT * FROM submenu WHERE urutan = 28";
	  $sres28 = mysql_query($ss28);
	  $sr28 = mysql_fetch_array($sres28);
	  $_sck28 = ($sr28['admin'] == 0) ? '' : 'checked';
	  
	  $ss29 = "SELECT * FROM submenu WHERE urutan = 29";
	  $sres29 = mysql_query($ss29);
	  $sr29 = mysql_fetch_array($sres29);
	  $_sck29 = ($sr29['admin'] == 0) ? '' : 'checked';
	  
	  $ss30 = "SELECT * FROM submenu WHERE urutan = 30";
	  $sres30 = mysql_query($ss30);
	  $sr30 = mysql_fetch_array($sres30);
	  $_sck30 = ($sr30['admin'] == 0) ? '' : 'checked';
	  
	  $ss31 = "SELECT * FROM submenu WHERE urutan = 31";
	  $sres31 = mysql_query($ss31);
	  $sr31 = mysql_fetch_array($sres31);
	  $_sck31 = ($sr31['admin'] == 0) ? '' : 'checked';
	  
	  $ss32 = "SELECT * FROM submenu WHERE urutan = 32";
	  $sres32 = mysql_query($ss32);
	  $sr32 = mysql_fetch_array($sres32);
	  $_sck32 = ($sr32['admin'] == 0) ? '' : 'checked';
	  
	  $ss33 = "SELECT * FROM submenu WHERE urutan = 33";
	  $sres33 = mysql_query($ss33);
	  $sr33 = mysql_fetch_array($sres33);
	  $_sck33 = ($sr33['admin'] == 0) ? '' : 'checked';
	  
	  $ss34 = "SELECT * FROM submenu WHERE urutan = 34";
	  $sres34 = mysql_query($ss34);
	  $sr34 = mysql_fetch_array($sres34);
	  $_sck34 = ($sr34['admin'] == 0) ? '' : 'checked';
	  
	  $ss35 = "SELECT * FROM submenu WHERE urutan = 35";
	  $sres35 = mysql_query($ss35);
	  $sr35 = mysql_fetch_array($sres35);
	  $_sck35 = ($sr35['admin'] == 0) ? '' : 'checked';
	  
	  $ss36 = "SELECT * FROM submenu WHERE urutan = 36";
	  $sres36 = mysql_query($ss36);
	  $sr36 = mysql_fetch_array($sres36);
	  $_sck36 = ($sr36['admin'] == 0) ? '' : 'checked';
	  
	  $ss37 = "SELECT * FROM submenu WHERE urutan = 37";
	  $sres37 = mysql_query($ss37);
	  $sr37 = mysql_fetch_array($sres37);
	  $_sck37 = ($sr37['admin'] == 0) ? '' : 'checked';
	  
	  $ss38 = "SELECT * FROM submenu WHERE urutan = 38";
	  $sres38 = mysql_query($ss38);
	  $sr38 = mysql_fetch_array($sres38);
	  $_sck38 = ($sr38['admin'] == 0) ? '' : 'checked';
	  
	  $ss39 = "SELECT * FROM submenu WHERE urutan = 39";
	  $sres39 = mysql_query($ss39);
	  $sr39 = mysql_fetch_array($sres39);
	  $_sck39 = ($sr39['admin'] == 0) ? '' : 'checked';
	  
	  $ss40 = "SELECT * FROM submenu WHERE urutan = 40";
	  $sres40 = mysql_query($ss40);
	  $sr40 = mysql_fetch_array($sres40);
	  $_sck40 = ($sr40['admin'] == 0) ? '' : 'checked';
	  
	  $ss41 = "SELECT * FROM submenu WHERE urutan = 41";
	  $sres41 = mysql_query($ss41);
	  $sr41 = mysql_fetch_array($sres41);
	  $_sck41 = ($sr41['admin'] == 0) ? '' : 'checked';
	  
	  $ss42 = "SELECT * FROM submenu WHERE urutan = 42";
	  $sres42 = mysql_query($ss42);
	  $sr42 = mysql_fetch_array($sres42);
	  $_sck42 = ($sr42['admin'] == 0) ? '' : 'checked';
	  
	  $ss43 = "SELECT * FROM submenu WHERE urutan = 43";
	  $sres43 = mysql_query($ss43);
	  $sr43 = mysql_fetch_array($sres43);
	  $_sck43 = ($sr43['admin'] == 0) ? '' : 'checked';
	  
	  $ss44 = "SELECT * FROM submenu WHERE urutan = 44";
	  $sres44 = mysql_query($ss44);
	  $sr44 = mysql_fetch_array($sres44);
	  $_sck44 = ($sr44['admin'] == 0) ? '' : 'checked';

  }else if ($idx == 2){
	if(isset($_POST['submit'])) {   	
		if (isset($_POST['mr1']))
		{
			$read = $_POST['mr1'];
			if($read == 'on'){
				$n1 = 1;
			}			
		}else{
			$n1 = 0;
		}		
		if (isset($_POST['mr2']))
		{
			$read = $_POST['mr2'];
			if($read == 'on'){
				$n2 = 1;
			}			
		}else{
			$n2 = 0;
		}
		if (isset($_POST['mr3']))
		{
			$read = $_POST['mr3'];
			if($read == 'on'){
				$n3 = 1;
			}			
		}else{
			$n3 = 0;
		}
		if (isset($_POST['mr4']))
		{
			$read = $_POST['mr4'];
			if($read == 'on'){
				$n4 = 1;
			}			
		}else{
			$n4 = 0;
		}
		if (isset($_POST['mr5']))
		{
			$read = $_POST['mr5'];
			if($read == 'on'){
				$n5 = 1;
			}			
		}else{
			$n5 = 0;
		}
		if (isset($_POST['mr6']))
		{
			$read = $_POST['mr6'];
			if($read == 'on'){
				$n6 = 1;
			}			
		}else{
			$n6 = 0;
		}
		if (isset($_POST['mr7']))
		{
			$read = $_POST['mr7'];
			if($read == 'on'){
				$n7 = 1;
			}
		}else{
			$n7 = 0;
		}
		if (isset($_POST['mr8']))
		{
			$read = $_POST['mr8'];
			if($read == 'on'){
				$n8 = 1;
			}
		}else{
			$n8 = 0;
		}
		if (isset($_POST['mr9']))
		{
			$read = $_POST['mr9'];
			if($read == 'on'){
				$n9 = 1;
			}
		}else{
			$n9 = 0;
		}
		if (isset($_POST['mr10']))
		{
			$read = $_POST['mr10'];
			if($read == 'on'){
				$n10 = 1;
			}
		}else{
			$n10 = 0;
		}
		if (isset($_POST['mr11']))
		{
			$read = $_POST['mr11'];
			if($read == 'on'){
				$n11 = 1;
			}
		}else{
			$n11 = 0;
		}
				
		mysql_query("UPDATE mainmenu SET user = $n1 WHERE urutan = 1");
		mysql_query("UPDATE mainmenu SET user = $n2 WHERE urutan = 2");
		mysql_query("UPDATE mainmenu SET user = $n3 WHERE urutan = 3");
		mysql_query("UPDATE mainmenu SET user = $n4 WHERE urutan = 4");
		mysql_query("UPDATE mainmenu SET user = $n5 WHERE urutan = 5");
		mysql_query("UPDATE mainmenu SET user = $n6 WHERE urutan = 6");
		mysql_query("UPDATE mainmenu SET user = $n7 WHERE urutan = 7");
		mysql_query("UPDATE mainmenu SET user = $n8 WHERE urutan = 8");
		mysql_query("UPDATE mainmenu SET user = $n9 WHERE urutan = 9");
		
		if (isset($_POST['sr1']))
		{
			$read = $_POST['sr1'];
			if($read == 'on'){
				$sn1 = 1;
			}
		}else{
			$sn1 = 0;
		}
		if (isset($_POST['sr2']))
		{
			$read = $_POST['sr2'];
			if($read == 'on'){
				$sn2 = 1;
			}
		}else{
			$sn2 = 0;
		}
		if (isset($_POST['sr3']))
		{
			$read = $_POST['sr3'];
			if($read == 'on'){
				$sn3 = 1;
			}
		}else{
			$sn3 = 0;
		}
		if (isset($_POST['sr4']))
		{
			$read = $_POST['sr4'];
			if($read == 'on'){
				$sn4 = 1;
			}
		}else{
			$sn4 = 0;
		}
		if (isset($_POST['sr5']))
		{
			$read = $_POST['sr5'];
			if($read == 'on'){
				$sn5 = 1;
			}
		}else{
			$sn5 = 0;
		}
		if (isset($_POST['sr6']))
		{
			$read = $_POST['sr6'];
			if($read == 'on'){
				$sn6 = 1;
			}
		}else{
			$sn6 = 0;
		}
		if (isset($_POST['sr7']))
		{
			$read = $_POST['sr7'];
			if($read == 'on'){
				$sn7 = 1;
			}
		}else{
			$sn7 = 0;
		}
		if (isset($_POST['sr8']))
		{
			$read = $_POST['sr8'];
			if($read == 'on'){
				$sn8 = 1;
			}
		}else{
			$sn8 = 0;
		}
		if (isset($_POST['sr9']))
		{
			$read = $_POST['sr9'];
			if($read == 'on'){
				$sn9 = 1;
			}
		}else{
			$sn9 = 0;
		}
		if (isset($_POST['sr10']))
		{
			$read = $_POST['sr10'];
			if($read == 'on'){
				$sn10 = 1;
			}
		}else{
			$sn10 = 0;
		}
		if (isset($_POST['sr11']))
		{
			$read = $_POST['sr11'];
			if($read == 'on'){
				$sn11 = 1;
			}
		}else{
			$sn11 = 0;
		}
		if (isset($_POST['sr12']))
		{
			$read = $_POST['sr12'];
			if($read == 'on'){
				$sn12 = 1;
			}
		}else{
			$sn12 = 0;
		}
		if (isset($_POST['sr13']))
		{
			$read = $_POST['sr13'];
			if($read == 'on'){
				$sn13 = 1;
			}
		}else{
			$sn13 = 0;
		}
		if (isset($_POST['sr14']))
		{
			$read = $_POST['sr14'];
			if($read == 'on'){
				$sn14 = 1;
			}
		}else{
			$sn14 = 0;
		}
		if (isset($_POST['sr15']))
		{
			$read = $_POST['sr15'];
			if($read == 'on'){
				$sn15 = 1;
			}
		}else{
			$sn15 = 0;
		}
		if (isset($_POST['sr16']))
		{
			$read = $_POST['sr16'];
			if($read == 'on'){
				$sn16 = 1;
			}
		}else{
			$sn16 = 0;
		}
		if (isset($_POST['sr17']))
		{
			$read = $_POST['sr17'];
			if($read == 'on'){
				$sn17 = 1;
			}
		}else{
			$sn17 = 0;
		}
		if (isset($_POST['sr18']))
		{
			$read = $_POST['sr18'];
			if($read == 'on'){
				$sn18 = 1;
			}
		}else{
			$sn18 = 0;
		}
		if (isset($_POST['sr19']))
		{
			$read = $_POST['sr19'];
			if($read == 'on'){
				$sn19 = 1;
			}
		}else{
			$sn19 = 0;
		}
		if (isset($_POST['sr20']))
		{
			$read = $_POST['sr20'];
			if($read == 'on'){
				$sn20 = 1;
			}
		}else{
			$sn20 = 0;
		}
		if (isset($_POST['sr21']))
		{
			$read = $_POST['sr21'];
			if($read == 'on'){
				$sn21 = 1;
			}
		}else{
			$sn21 = 0;
		}
		if (isset($_POST['sr22']))
		{
			$read = $_POST['sr22'];
			if($read == 'on'){
				$sn22 = 1;
			}
		}else{
			$sn22 = 0;
		}
		if (isset($_POST['sr23']))
		{
			$read = $_POST['sr23'];
			if($read == 'on'){
				$sn23 = 1;
			}
		}else{
			$sn23 = 0;
		}
		if (isset($_POST['sr24']))
		{
			$read = $_POST['sr24'];
			if($read == 'on'){
				$sn24 = 1;
			}
		}else{
			$sn24 = 0;
		}
		if (isset($_POST['sr25']))
		{
			$read = $_POST['sr25'];
			if($read == 'on'){
				$sn25 = 1;
			}
		}else{
			$sn25 = 0;
		}
		if (isset($_POST['sr26']))
		{
			$read = $_POST['sr26'];
			if($read == 'on'){
				$sn26 = 1;
			}
		}else{
			$sn26 = 0;
		}
		if (isset($_POST['sr27']))
		{
			$read = $_POST['sr27'];
			if($read == 'on'){
				$sn27 = 1;
			}
		}else{
			$sn27 = 0;
		}
		if (isset($_POST['sr28']))
		{
			$read = $_POST['sr28'];
			if($read == 'on'){
				$sn28 = 1;
			}
		}else{
			$sn28 = 0;
		}
		if (isset($_POST['sr29']))
		{
			$read = $_POST['sr29'];
			if($read == 'on'){
				$sn29 = 1;
			}
		}else{
			$sn29 = 0;
		}
		if (isset($_POST['sr30']))
		{
			$read = $_POST['sr30'];
			if($read == 'on'){
				$sn30 = 1;
			}
		}else{
			$sn30 = 0;
		}
		if (isset($_POST['sr31']))
		{
			$read = $_POST['sr31'];
			if($read == 'on'){
				$sn31 = 1;
			}
		}else{
			$sn31 = 0;
		}
		if (isset($_POST['sr32']))
		{
			$read = $_POST['sr32'];
			if($read == 'on'){
				$sn32 = 1;
			}
		}else{
			$sn32 = 0;
		}
		if (isset($_POST['sr33']))
		{
			$read = $_POST['sr33'];
			if($read == 'on'){
				$sn33 = 1;
			}
		}else{
			$sn33 = 0;
		}
		if (isset($_POST['sr34']))
		{
			$read = $_POST['sr34'];
			if($read == 'on'){
				$sn34 = 1;
			}
		}else{
			$sn34 = 0;
		}
		if (isset($_POST['sr35']))
		{
			$read = $_POST['sr35'];
			if($read == 'on'){
				$sn35 = 1;
			}
		}else{
			$sn35 = 0;
		}
		if (isset($_POST['sr36']))
		{
			$read = $_POST['sr36'];
			if($read == 'on'){
				$sn36 = 1;
			}
		}else{
			$sn36 = 0;
		}
		if (isset($_POST['sr37']))
		{
			$read = $_POST['sr37'];
			if($read == 'on'){
				$sn37 = 1;
			}
		}else{
			$sn37 = 0;
		}
		if (isset($_POST['sr38']))
		{
			$read = $_POST['sr38'];
			if($read == 'on'){
				$sn38 = 1;
			}
		}else{
			$sn38 = 0;
		}
		if (isset($_POST['sr39']))
		{
			$read = $_POST['sr39'];
			if($read == 'on'){
				$sn39 = 1;
			}
		}else{
			$sn39 = 0;
		}
		if (isset($_POST['sr40']))
		{
			$read = $_POST['sr40'];
			if($read == 'on'){
				$sn40 = 1;
			}
		}else{
			$sn40 = 0;
		}
		if (isset($_POST['sr41']))
		{
			$read = $_POST['sr41'];
			if($read == 'on'){
				$sn41 = 1;
			}
		}else{
			$sn41 = 0;
		}
		if (isset($_POST['sr42']))
		{
			$read = $_POST['sr42'];
			if($read == 'on'){
				$sn42 = 1;
			}
		}else{
			$sn42 = 0;
		}
		if (isset($_POST['sr43']))
		{
			$read = $_POST['sr43'];
			if($read == 'on'){
				$sn43 = 1;
			}
		}else{
			$sn43 = 0;
		}
		if (isset($_POST['sr44']))
		{
			$read = $_POST['sr44'];
			if($read == 'on'){
				$sn44 = 1;
			}
		}else{
			$sn44 = 0;
		}
		
		mysql_query("UPDATE submenu SET user = $sn1 WHERE urutan = 1");
		mysql_query("UPDATE submenu SET user = $sn2 WHERE urutan = 2");
		mysql_query("UPDATE submenu SET user = $sn3 WHERE urutan = 3");
		mysql_query("UPDATE submenu SET user = $sn4 WHERE urutan = 4");
		mysql_query("UPDATE submenu SET user = $sn5 WHERE urutan = 5");
		mysql_query("UPDATE submenu SET user = $sn6 WHERE urutan = 6");
		mysql_query("UPDATE submenu SET user = $sn7 WHERE urutan = 7");
		mysql_query("UPDATE submenu SET user = $sn8 WHERE urutan = 8");
		mysql_query("UPDATE submenu SET user = $sn9 WHERE urutan = 9");
		mysql_query("UPDATE submenu SET user = $sn10 WHERE urutan = 10");
		mysql_query("UPDATE submenu SET user = $sn11 WHERE urutan = 11");
		mysql_query("UPDATE submenu SET user = $sn12 WHERE urutan = 12");
		mysql_query("UPDATE submenu SET user = $sn13 WHERE urutan = 13");
		mysql_query("UPDATE submenu SET user = $sn14 WHERE urutan = 14");
		mysql_query("UPDATE submenu SET user = $sn15 WHERE urutan = 15");
		mysql_query("UPDATE submenu SET user = $sn16 WHERE urutan = 16");
		mysql_query("UPDATE submenu SET user = $sn17 WHERE urutan = 17");
		mysql_query("UPDATE submenu SET user = $sn18 WHERE urutan = 18");
		mysql_query("UPDATE submenu SET user = $sn19 WHERE urutan = 19");
		mysql_query("UPDATE submenu SET user = $sn20 WHERE urutan = 20");
		mysql_query("UPDATE submenu SET user = $sn21 WHERE urutan = 21");
		mysql_query("UPDATE submenu SET user = $sn22 WHERE urutan = 22");
		mysql_query("UPDATE submenu SET user = $sn23 WHERE urutan = 23");
		mysql_query("UPDATE submenu SET user = $sn24 WHERE urutan = 24");
		mysql_query("UPDATE submenu SET user = $sn25 WHERE urutan = 25");
		mysql_query("UPDATE submenu SET user = $sn26 WHERE urutan = 26");
		mysql_query("UPDATE submenu SET user = $sn27 WHERE urutan = 27");
		mysql_query("UPDATE submenu SET user = $sn28 WHERE urutan = 28");
		mysql_query("UPDATE submenu SET user = $sn29 WHERE urutan = 29");
		mysql_query("UPDATE submenu SET user = $sn30 WHERE urutan = 30");
		mysql_query("UPDATE submenu SET user = $sn31 WHERE urutan = 31");
		mysql_query("UPDATE submenu SET user = $sn32 WHERE urutan = 32");
		mysql_query("UPDATE submenu SET user = $sn33 WHERE urutan = 33");
		mysql_query("UPDATE submenu SET user = $sn34 WHERE urutan = 34");
		mysql_query("UPDATE submenu SET user = $sn35 WHERE urutan = 35");
		mysql_query("UPDATE submenu SET user = $sn36 WHERE urutan = 36");
		mysql_query("UPDATE submenu SET user = $sn37 WHERE urutan = 37");
		mysql_query("UPDATE submenu SET user = $sn38 WHERE urutan = 38");
		mysql_query("UPDATE submenu SET user = $sn39 WHERE urutan = 39");
		mysql_query("UPDATE submenu SET user = $sn40 WHERE urutan = 40");
		mysql_query("UPDATE submenu SET user = $sn41 WHERE urutan = 41");
		mysql_query("UPDATE submenu SET user = $sn42 WHERE urutan = 42");
		mysql_query("UPDATE submenu SET user = $sn43 WHERE urutan = 43");
		//mysql_query("UPDATE submenu SET user = $sn44 WHERE urutan = 44");
					
		echo '<meta http-equiv="refresh" content="0">';
	}
  
	  $ms1 = "SELECT * FROM mainmenu WHERE urutan = 1";
	  $mres1 = mysql_query($ms1);
	  $mr1 = mysql_fetch_array($mres1);
	  $_mck1 = ($mr1['user'] == 0) ? '' : 'checked';
	  
	  $ms2 = "SELECT * FROM mainmenu WHERE urutan = 2";
	  $mres2 = mysql_query($ms2);
	  $mr2 = mysql_fetch_array($mres2);
	  $_mck2 = ($mr2['user'] == 0) ? '' : 'checked';
	  
	  $ms3 = "SELECT * FROM mainmenu WHERE urutan = 3";
	  $mres3 = mysql_query($ms3);
	  $mr3 = mysql_fetch_array($mres3);
	  $_mck3 = ($mr3['user'] == 0) ? '' : 'checked';
	  
	  $ms4 = "SELECT * FROM mainmenu WHERE urutan = 4";
	  $mres4 = mysql_query($ms4);
	  $mr4 = mysql_fetch_array($mres4);
	  $_mck4 = ($mr4['user'] == 0) ? '' : 'checked';
	  
	  $ms5 = "SELECT * FROM mainmenu WHERE urutan = 5";
	  $mres5 = mysql_query($ms5);
	  $mr5 = mysql_fetch_array($mres5);
	  $_mck5 = ($mr5['user'] == 0) ? '' : 'checked';
	  
	  $ms6 = "SELECT * FROM mainmenu WHERE urutan = 6";
	  $mres6 = mysql_query($ms6);
	  $mr6 = mysql_fetch_array($mres6);
	  $_mck6 = ($mr6['user'] == 0) ? '' : 'checked';
	  
	  $ms7 = "SELECT * FROM mainmenu WHERE urutan = 7";
	  $mres7 = mysql_query($ms7);
	  $mr7 = mysql_fetch_array($mres7);
	  $_mck7 = ($mr7['user'] == 0) ? '' : 'checked';
	  
	  $ms8 = "SELECT * FROM mainmenu WHERE urutan = 8";
	  $mres8 = mysql_query($ms8);
	  $mr8 = mysql_fetch_array($mres8);
	  $_mck8 = ($mr8['user'] == 0) ? '' : 'checked';
	  
	  $ms9 = "SELECT * FROM mainmenu WHERE urutan = 9";
	  $mres9 = mysql_query($ms9);
	  $mr9 = mysql_fetch_array($mres9);
	  $_mck9 = ($mr9['user'] == 0) ? '' : 'checked';
	  
	  $ms10 = "SELECT * FROM mainmenu WHERE urutan = 10";
	  $mres10 = mysql_query($ms10);
	  $mr10 = mysql_fetch_array($mres10);
	  $_mck10 = ($mr10['user'] == 0) ? '' : 'checked';
	  
	  $ms11 = "SELECT * FROM mainmenu WHERE urutan = 11";
	  $mres11 = mysql_query($ms11);
	  $mr11 = mysql_fetch_array($mres11);
	  $_mck11 = ($mr11['user'] == 0) ? '' : 'checked';
	
	  $ss1 = "SELECT * FROM submenu WHERE urutan = 1";
	  $sres1 = mysql_query($ss1);
	  $sr1 = mysql_fetch_array($sres1);
	  $_sck1 = ($sr1['user'] == 0) ? '' : 'checked';
	  
	  $ss2 = "SELECT * FROM mainmenu WHERE urutan = 2";
	  $sres2 = mysql_query($ss2);
	  $sr2 = mysql_fetch_array($sres2);
	  $_sck2 = ($sr2['user'] == 0) ? '' : 'checked';
	  
	  $ss3 = "SELECT * FROM mainmenu WHERE urutan = 3";
	  $sres3 = mysql_query($ss3);
	  $sr3 = mysql_fetch_array($sres3);
	  $_sck3 = ($sr3['user'] == 0) ? '' : 'checked';
	  
	  $ss4 = "SELECT * FROM mainmenu WHERE urutan = 4";
	  $sres4 = mysql_query($ss4);
	  $sr4 = mysql_fetch_array($sres4);
	  $_sck4 = ($sr4['user'] == 0) ? '' : 'checked';
	  
	  $ss5 = "SELECT * FROM mainmenu WHERE urutan = 5";
	  $sres5 = mysql_query($ss5);
	  $sr5 = mysql_fetch_array($sres5);
	  $_sck5 = ($sr5['user'] == 0) ? '' : 'checked';
	  
	  $ss6 = "SELECT * FROM mainmenu WHERE urutan = 6";
	  $sres6 = mysql_query($ss6);
	  $sr6 = mysql_fetch_array($sres6);
	  $_sck6 = ($sr6['user'] == 0) ? '' : 'checked';
	  
	  $ss7 = "SELECT * FROM mainmenu WHERE urutan = 7";
	  $sres7 = mysql_query($ss7);
	  $sr7 = mysql_fetch_array($sres7);
	  $_sck7 = ($sr7['user'] == 0) ? '' : 'checked';
	  
	  $ss8 = "SELECT * FROM mainmenu WHERE urutan = 8";
	  $sres8 = mysql_query($ss8);
	  $sr8 = mysql_fetch_array($sres8);
	  $_sck8 = ($sr8['user'] == 0) ? '' : 'checked';
	  
	  $ss9 = "SELECT * FROM mainmenu WHERE urutan = 9";
	  $sres9 = mysql_query($ss9);
	  $sr9 = mysql_fetch_array($sres9);
	  $_sck9 = ($sr9['user'] == 0) ? '' : 'checked';
	  
	  $ss10 = "SELECT * FROM mainmenu WHERE urutan = 10";
	  $sres10 = mysql_query($ss10);
	  $sr10 = mysql_fetch_array($sres10);
	  $_sck10 = ($sr10['user'] == 0) ? '' : 'checked';
	  
	  $ss11 = "SELECT * FROM mainmenu WHERE urutan = 11";
	  $sres11 = mysql_query($ss11);
	  $sr11 = mysql_fetch_array($sres11);
	  $_sck11 = ($sr11['user'] == 0) ? '' : 'checked';
	  
	  $ss2 = "SELECT * FROM submenu WHERE urutan = 2";
	  $sres2 = mysql_query($ss2);
	  $sr2 = mysql_fetch_array($sres2);
	  $_sck2 = ($sr2['user'] == 0) ? '' : 'checked';
	  
	  $ss3 = "SELECT * FROM submenu WHERE urutan = 3";
	  $sres3 = mysql_query($ss3);
	  $sr3 = mysql_fetch_array($sres3);
	  $_sck3 = ($sr3['user'] == 0) ? '' : 'checked';
	  
	  $ss4 = "SELECT * FROM submenu WHERE urutan = 4";
	  $sres4 = mysql_query($ss4);
	  $sr4 = mysql_fetch_array($sres4);
	  $_sck4 = ($sr4['user'] == 0) ? '' : 'checked';
	  
	  $ss5 = "SELECT * FROM submenu WHERE urutan = 5";
	  $sres5 = mysql_query($ss5);
	  $sr5 = mysql_fetch_array($sres5);
	  $_sck5 = ($sr5['user'] == 0) ? '' : 'checked';
	  
	  $ss6 = "SELECT * FROM submenu WHERE urutan = 6";
	  $sres6 = mysql_query($ss6);
	  $sr6 = mysql_fetch_array($sres6);
	  $_sck6 = ($sr6['user'] == 0) ? '' : 'checked';
	  
	  $ss7 = "SELECT * FROM submenu WHERE urutan = 7";
	  $sres7 = mysql_query($ss7);
	  $sr7 = mysql_fetch_array($sres7);
	  $_sck7 = ($sr7['user'] == 0) ? '' : 'checked';
	  
	  $ss8 = "SELECT * FROM submenu WHERE urutan = 8";
	  $sres8 = mysql_query($ss8);
	  $sr8 = mysql_fetch_array($sres8);
	  $_sck8 = ($sr8['user'] == 0) ? '' : 'checked';
	  
	  $ss9 = "SELECT * FROM submenu WHERE urutan = 9";
	  $sres9 = mysql_query($ss9);
	  $sr9 = mysql_fetch_array($sres9);
	  $_sck9 = ($sr9['user'] == 0) ? '' : 'checked';
	  
	  $ss10 = "SELECT * FROM submenu WHERE urutan = 10";
	  $sres10 = mysql_query($ss10);
	  $sr10 = mysql_fetch_array($sres10);
	  $_sck10 = ($sr10['user'] == 0) ? '' : 'checked';
	  
	  $ss11 = "SELECT * FROM submenu WHERE urutan = 11";
	  $sres11 = mysql_query($ss11);
	  $sr11 = mysql_fetch_array($sres11);
	  $_sck11 = ($sr11['user'] == 0) ? '' : 'checked';
	  
	  $ss12 = "SELECT * FROM submenu WHERE urutan = 12";
	  $sres12 = mysql_query($ss12);
	  $sr12 = mysql_fetch_array($sres12);
	  $_sck12 = ($sr12['user'] == 0) ? '' : 'checked';
	  
	  $ss13 = "SELECT * FROM submenu WHERE urutan = 13";
	  $sres13 = mysql_query($ss13);
	  $sr13 = mysql_fetch_array($sres13);
	  $_sck13 = ($sr13['user'] == 0) ? '' : 'checked';
	  
	  $ss14 = "SELECT * FROM submenu WHERE urutan = 14";
	  $sres14 = mysql_query($ss14);
	  $sr14 = mysql_fetch_array($sres14);
	  $_sck14 = ($sr14['user'] == 0) ? '' : 'checked';
	  
	  $ss15 = "SELECT * FROM submenu WHERE urutan = 15";
	  $sres15 = mysql_query($ss15);
	  $sr15 = mysql_fetch_array($sres15);
	  $_sck15 = ($sr15['user'] == 0) ? '' : 'checked';
	  
	  $ss16 = "SELECT * FROM submenu WHERE urutan = 16";
	  $sres16 = mysql_query($ss16);
	  $sr16 = mysql_fetch_array($sres16);
	  $_sck16 = ($sr16['user'] == 0) ? '' : 'checked';
	  
	  $ss17 = "SELECT * FROM submenu WHERE urutan = 17";
	  $sres17 = mysql_query($ss17);
	  $sr17 = mysql_fetch_array($sres17);
	  $_sck17 = ($sr17['user'] == 0) ? '' : 'checked';
	  
	  $ss18 = "SELECT * FROM submenu WHERE urutan = 18";
	  $sres18 = mysql_query($ss18);
	  $sr18 = mysql_fetch_array($sres18);
	  $_sck18 = ($sr18['user'] == 0) ? '' : 'checked';
	  
	  $ss19 = "SELECT * FROM submenu WHERE urutan = 19";
	  $sres19 = mysql_query($ss19);
	  $sr19 = mysql_fetch_array($sres19);
	  $_sck19 = ($sr19['user'] == 0) ? '' : 'checked';
	  
	  $ss20 = "SELECT * FROM submenu WHERE urutan = 20";
	  $sres20 = mysql_query($ss20);
	  $sr20 = mysql_fetch_array($sres20);
	  $_sck20 = ($sr20['user'] == 0) ? '' : 'checked';
	  
	  $ss21 = "SELECT * FROM submenu WHERE urutan = 21";
	  $sres21 = mysql_query($ss21);
	  $sr21 = mysql_fetch_array($sres21);
	  $_sck21 = ($sr21['user'] == 0) ? '' : 'checked';
	  
	  $ss22 = "SELECT * FROM submenu WHERE urutan = 22";
	  $sres22 = mysql_query($ss22);
	  $sr22 = mysql_fetch_array($sres22);
	  $_sck22 = ($sr22['user'] == 0) ? '' : 'checked';
	  
	  $ss23 = "SELECT * FROM submenu WHERE urutan = 23";
	  $sres23 = mysql_query($ss23);
	  $sr23 = mysql_fetch_array($sres23);
	  $_sck23 = ($sr23['user'] == 0) ? '' : 'checked';
	  
	  $ss24 = "SELECT * FROM submenu WHERE urutan = 24";
	  $sres24 = mysql_query($ss24);
	  $sr24 = mysql_fetch_array($sres24);
	  $_sck24 = ($sr24['user'] == 0) ? '' : 'checked';
	  
	  $ss25 = "SELECT * FROM submenu WHERE urutan = 25";
	  $sres25 = mysql_query($ss25);
	  $sr25 = mysql_fetch_array($sres25);
	  $_sck25 = ($sr25['user'] == 0) ? '' : 'checked';
	  
	  $ss26 = "SELECT * FROM submenu WHERE urutan = 26";
	  $sres26 = mysql_query($ss26);
	  $sr26 = mysql_fetch_array($sres26);
	  $_sck26 = ($sr26['user'] == 0) ? '' : 'checked';
	  
	  $ss27 = "SELECT * FROM submenu WHERE urutan = 27";
	  $sres27 = mysql_query($ss27);
	  $sr27 = mysql_fetch_array($sres27);
	  $_sck27 = ($sr27['user'] == 0) ? '' : 'checked';
	  
	  $ss28 = "SELECT * FROM submenu WHERE urutan = 28";
	  $sres28 = mysql_query($ss28);
	  $sr28 = mysql_fetch_array($sres28);
	  $_sck28 = ($sr28['user'] == 0) ? '' : 'checked';
	  
	  $ss29 = "SELECT * FROM submenu WHERE urutan = 29";
	  $sres29 = mysql_query($ss29);
	  $sr29 = mysql_fetch_array($sres29);
	  $_sck29 = ($sr29['user'] == 0) ? '' : 'checked';
	  
	  $ss30 = "SELECT * FROM submenu WHERE urutan = 30";
	  $sres30 = mysql_query($ss30);
	  $sr30 = mysql_fetch_array($sres30);
	  $_sck30 = ($sr30['user'] == 0) ? '' : 'checked';
	  
	  $ss31 = "SELECT * FROM submenu WHERE urutan = 31";
	  $sres31 = mysql_query($ss31);
	  $sr31 = mysql_fetch_array($sres31);
	  $_sck31 = ($sr31['user'] == 0) ? '' : 'checked';
	  
	  $ss32 = "SELECT * FROM submenu WHERE urutan = 32";
	  $sres32 = mysql_query($ss32);
	  $sr32 = mysql_fetch_array($sres32);
	  $_sck32 = ($sr32['user'] == 0) ? '' : 'checked';
	  
	  $ss33 = "SELECT * FROM submenu WHERE urutan = 33";
	  $sres33 = mysql_query($ss33);
	  $sr33 = mysql_fetch_array($sres33);
	  $_sck33 = ($sr33['user'] == 0) ? '' : 'checked';
	  
	  $ss34 = "SELECT * FROM submenu WHERE urutan = 34";
	  $sres34 = mysql_query($ss34);
	  $sr34 = mysql_fetch_array($sres34);
	  $_sck34 = ($sr34['user'] == 0) ? '' : 'checked';
	  
	  $ss35 = "SELECT * FROM submenu WHERE urutan = 35";
	  $sres35 = mysql_query($ss35);
	  $sr35 = mysql_fetch_array($sres35);
	  $_sck35 = ($sr35['user'] == 0) ? '' : 'checked';
	  
	  $ss36 = "SELECT * FROM submenu WHERE urutan = 36";
	  $sres36 = mysql_query($ss36);
	  $sr36 = mysql_fetch_array($sres36);
	  $_sck36 = ($sr36['user'] == 0) ? '' : 'checked';
	  
	  $ss37 = "SELECT * FROM submenu WHERE urutan = 37";
	  $sres37 = mysql_query($ss37);
	  $sr37 = mysql_fetch_array($sres37);
	  $_sck37 = ($sr37['user'] == 0) ? '' : 'checked';
	  
	  $ss38 = "SELECT * FROM submenu WHERE urutan = 38";
	  $sres38 = mysql_query($ss38);
	  $sr38 = mysql_fetch_array($sres38);
	  $_sck38 = ($sr38['user'] == 0) ? '' : 'checked';
	  
	  $ss39 = "SELECT * FROM submenu WHERE urutan = 39";
	  $sres39 = mysql_query($ss39);
	  $sr39 = mysql_fetch_array($sres39);
	  $_sck39 = ($sr39['user'] == 0) ? '' : 'checked';
	  
	  $ss40 = "SELECT * FROM submenu WHERE urutan = 40";
	  $sres40 = mysql_query($ss40);
	  $sr40 = mysql_fetch_array($sres40);
	  $_sck40 = ($sr40['user'] == 0) ? '' : 'checked';
	  
	  $ss41 = "SELECT * FROM submenu WHERE urutan = 41";
	  $sres41 = mysql_query($ss41);
	  $sr41 = mysql_fetch_array($sres41);
	  $_sck41 = ($sr41['user'] == 0) ? '' : 'checked';
	  
	  $ss42 = "SELECT * FROM submenu WHERE urutan = 42";
	  $sres42 = mysql_query($ss42);
	  $sr42 = mysql_fetch_array($sres42);
	  $_sck42 = ($sr42['user'] == 0) ? '' : 'checked';
	  
	  $ss43 = "SELECT * FROM submenu WHERE urutan = 43";
	  $sres43 = mysql_query($ss43);
	  $sr43 = mysql_fetch_array($sres43);
	  $_sck43 = ($sr43['user'] == 0) ? '' : 'checked';
	  
	  $ss44 = "SELECT * FROM submenu WHERE urutan = 44";
	  $sres44 = mysql_query($ss44);
	  $sr44 = mysql_fetch_array($sres44);
	  $_sck44 = ($sr44['user'] == 0) ? '' : 'checked';
	  
  }else if ($idx == 3){
    if(isset($_POST['submit'])) {   	
		if (isset($_POST['mr1']))
		{
			$read = $_POST['mr1'];
			if($read == 'on'){
				$n1 = 1;
			}			
		}else{
			$n1 = 0;
		}		
		if (isset($_POST['mr2']))
		{
			$read = $_POST['mr2'];
			if($read == 'on'){
				$n2 = 1;
			}			
		}else{
			$n2 = 0;
		}
		if (isset($_POST['mr3']))
		{
			$read = $_POST['mr3'];
			if($read == 'on'){
				$n3 = 1;
			}			
		}else{
			$n3 = 0;
		}
		if (isset($_POST['mr4']))
		{
			$read = $_POST['mr4'];
			if($read == 'on'){
				$n4 = 1;
			}			
		}else{
			$n4 = 0;
		}
		if (isset($_POST['mr5']))
		{
			$read = $_POST['mr5'];
			if($read == 'on'){
				$n5 = 1;
			}			
		}else{
			$n5 = 0;
		}
		if (isset($_POST['mr6']))
		{
			$read = $_POST['mr6'];
			if($read == 'on'){
				$n6 = 1;
			}			
		}else{
			$n6 = 0;
		}
		if (isset($_POST['mr7']))
		{
			$read = $_POST['mr7'];
			if($read == 'on'){
				$n7 = 1;
			}
		}else{
			$n7 = 0;
		}
		if (isset($_POST['mr8']))
		{
			$read = $_POST['mr8'];
			if($read == 'on'){
				$n8 = 1;
			}
		}else{
			$n8 = 0;
		}
		if (isset($_POST['mr9']))
		{
			$read = $_POST['mr9'];
			if($read == 'on'){
				$n9 = 1;
			}
		}else{
			$n9 = 0;
		}
		if (isset($_POST['mr10']))
		{
			$read = $_POST['mr10'];
			if($read == 'on'){
				$n10 = 1;
			}
		}else{
			$n10 = 0;
		}
		if (isset($_POST['mr11']))
		{
			$read = $_POST['mr11'];
			if($read == 'on'){
				$n11 = 1;
			}
		}else{
			$n11 = 0;
		}
				
		mysql_query("UPDATE mainmenu SET operator = $n1 WHERE urutan = 1");
		mysql_query("UPDATE mainmenu SET operator = $n2 WHERE urutan = 2");
		mysql_query("UPDATE mainmenu SET operator = $n3 WHERE urutan = 3");
		mysql_query("UPDATE mainmenu SET operator = $n4 WHERE urutan = 4");
		mysql_query("UPDATE mainmenu SET operator = $n5 WHERE urutan = 5");
		mysql_query("UPDATE mainmenu SET operator = $n6 WHERE urutan = 6");
		mysql_query("UPDATE mainmenu SET operator = $n7 WHERE urutan = 7");
		mysql_query("UPDATE mainmenu SET operator = $n8 WHERE urutan = 8");
		mysql_query("UPDATE mainmenu SET operator = $n9 WHERE urutan = 9");
		
		if (isset($_POST['sr1']))
		{
			$read = $_POST['sr1'];
			if($read == 'on'){
				$sn1 = 1;
			}
		}else{
			$sn1 = 0;
		}
		if (isset($_POST['sr2']))
		{
			$read = $_POST['sr2'];
			if($read == 'on'){
				$sn2 = 1;
			}
		}else{
			$sn2 = 0;
		}
		if (isset($_POST['sr3']))
		{
			$read = $_POST['sr3'];
			if($read == 'on'){
				$sn3 = 1;
			}
		}else{
			$sn3 = 0;
		}
		if (isset($_POST['sr4']))
		{
			$read = $_POST['sr4'];
			if($read == 'on'){
				$sn4 = 1;
			}
		}else{
			$sn4 = 0;
		}
		if (isset($_POST['sr5']))
		{
			$read = $_POST['sr5'];
			if($read == 'on'){
				$sn5 = 1;
			}
		}else{
			$sn5 = 0;
		}
		if (isset($_POST['sr6']))
		{
			$read = $_POST['sr6'];
			if($read == 'on'){
				$sn6 = 1;
			}
		}else{
			$sn6 = 0;
		}
		if (isset($_POST['sr7']))
		{
			$read = $_POST['sr7'];
			if($read == 'on'){
				$sn7 = 1;
			}
		}else{
			$sn7 = 0;
		}
		if (isset($_POST['sr8']))
		{
			$read = $_POST['sr8'];
			if($read == 'on'){
				$sn8 = 1;
			}
		}else{
			$sn8 = 0;
		}
		if (isset($_POST['sr9']))
		{
			$read = $_POST['sr9'];
			if($read == 'on'){
				$sn9 = 1;
			}
		}else{
			$sn9 = 0;
		}
		if (isset($_POST['sr10']))
		{
			$read = $_POST['sr10'];
			if($read == 'on'){
				$sn10 = 1;
			}
		}else{
			$sn10 = 0;
		}
		if (isset($_POST['sr11']))
		{
			$read = $_POST['sr11'];
			if($read == 'on'){
				$sn11 = 1;
			}
		}else{
			$sn11 = 0;
		}
		if (isset($_POST['sr12']))
		{
			$read = $_POST['sr12'];
			if($read == 'on'){
				$sn12 = 1;
			}
		}else{
			$sn12 = 0;
		}
		if (isset($_POST['sr13']))
		{
			$read = $_POST['sr13'];
			if($read == 'on'){
				$sn13 = 1;
			}
		}else{
			$sn13 = 0;
		}
		if (isset($_POST['sr14']))
		{
			$read = $_POST['sr14'];
			if($read == 'on'){
				$sn14 = 1;
			}
		}else{
			$sn14 = 0;
		}
		if (isset($_POST['sr15']))
		{
			$read = $_POST['sr15'];
			if($read == 'on'){
				$sn15 = 1;
			}
		}else{
			$sn15 = 0;
		}
		if (isset($_POST['sr16']))
		{
			$read = $_POST['sr16'];
			if($read == 'on'){
				$sn16 = 1;
			}
		}else{
			$sn16 = 0;
		}
		if (isset($_POST['sr17']))
		{
			$read = $_POST['sr17'];
			if($read == 'on'){
				$sn17 = 1;
			}
		}else{
			$sn17 = 0;
		}
		if (isset($_POST['sr18']))
		{
			$read = $_POST['sr18'];
			if($read == 'on'){
				$sn18 = 1;
			}
		}else{
			$sn18 = 0;
		}
		if (isset($_POST['sr19']))
		{
			$read = $_POST['sr19'];
			if($read == 'on'){
				$sn19 = 1;
			}
		}else{
			$sn19 = 0;
		}
		if (isset($_POST['sr20']))
		{
			$read = $_POST['sr20'];
			if($read == 'on'){
				$sn20 = 1;
			}
		}else{
			$sn20 = 0;
		}
		if (isset($_POST['sr21']))
		{
			$read = $_POST['sr21'];
			if($read == 'on'){
				$sn21 = 1;
			}
		}else{
			$sn21 = 0;
		}
		if (isset($_POST['sr22']))
		{
			$read = $_POST['sr22'];
			if($read == 'on'){
				$sn22 = 1;
			}
		}else{
			$sn22 = 0;
		}
		if (isset($_POST['sr23']))
		{
			$read = $_POST['sr23'];
			if($read == 'on'){
				$sn23 = 1;
			}
		}else{
			$sn23 = 0;
		}
		if (isset($_POST['sr24']))
		{
			$read = $_POST['sr24'];
			if($read == 'on'){
				$sn24 = 1;
			}
		}else{
			$sn24 = 0;
		}
		if (isset($_POST['sr25']))
		{
			$read = $_POST['sr25'];
			if($read == 'on'){
				$sn25 = 1;
			}
		}else{
			$sn25 = 0;
		}
		if (isset($_POST['sr26']))
		{
			$read = $_POST['sr26'];
			if($read == 'on'){
				$sn26 = 1;
			}
		}else{
			$sn26 = 0;
		}
		if (isset($_POST['sr27']))
		{
			$read = $_POST['sr27'];
			if($read == 'on'){
				$sn27 = 1;
			}
		}else{
			$sn27 = 0;
		}
		if (isset($_POST['sr28']))
		{
			$read = $_POST['sr28'];
			if($read == 'on'){
				$sn28 = 1;
			}
		}else{
			$sn28 = 0;
		}
		if (isset($_POST['sr29']))
		{
			$read = $_POST['sr29'];
			if($read == 'on'){
				$sn29 = 1;
			}
		}else{
			$sn29 = 0;
		}
		if (isset($_POST['sr30']))
		{
			$read = $_POST['sr30'];
			if($read == 'on'){
				$sn30 = 1;
			}
		}else{
			$sn30 = 0;
		}
		if (isset($_POST['sr31']))
		{
			$read = $_POST['sr31'];
			if($read == 'on'){
				$sn31 = 1;
			}
		}else{
			$sn31 = 0;
		}
		if (isset($_POST['sr32']))
		{
			$read = $_POST['sr32'];
			if($read == 'on'){
				$sn32 = 1;
			}
		}else{
			$sn32 = 0;
		}
		if (isset($_POST['sr33']))
		{
			$read = $_POST['sr33'];
			if($read == 'on'){
				$sn33 = 1;
			}
		}else{
			$sn33 = 0;
		}
		if (isset($_POST['sr34']))
		{
			$read = $_POST['sr34'];
			if($read == 'on'){
				$sn34 = 1;
			}
		}else{
			$sn34 = 0;
		}
		if (isset($_POST['sr35']))
		{
			$read = $_POST['sr35'];
			if($read == 'on'){
				$sn35 = 1;
			}
		}else{
			$sn35 = 0;
		}
		if (isset($_POST['sr36']))
		{
			$read = $_POST['sr36'];
			if($read == 'on'){
				$sn36 = 1;
			}
		}else{
			$sn36 = 0;
		}
		if (isset($_POST['sr37']))
		{
			$read = $_POST['sr37'];
			if($read == 'on'){
				$sn37 = 1;
			}
		}else{
			$sn37 = 0;
		}
		if (isset($_POST['sr38']))
		{
			$read = $_POST['sr38'];
			if($read == 'on'){
				$sn38 = 1;
			}
		}else{
			$sn38 = 0;
		}
		if (isset($_POST['sr39']))
		{
			$read = $_POST['sr39'];
			if($read == 'on'){
				$sn39 = 1;
			}
		}else{
			$sn39 = 0;
		}
		if (isset($_POST['sr40']))
		{
			$read = $_POST['sr40'];
			if($read == 'on'){
				$sn40 = 1;
			}
		}else{
			$sn40 = 0;
		}
		if (isset($_POST['sr41']))
		{
			$read = $_POST['sr41'];
			if($read == 'on'){
				$sn41 = 1;
			}
		}else{
			$sn41 = 0;
		}
		if (isset($_POST['sr42']))
		{
			$read = $_POST['sr42'];
			if($read == 'on'){
				$sn42 = 1;
			}
		}else{
			$sn42 = 0;
		}
		if (isset($_POST['sr43']))
		{
			$read = $_POST['sr43'];
			if($read == 'on'){
				$sn43 = 1;
			}
		}else{
			$sn43 = 0;
		}
		if (isset($_POST['sr44']))
		{
			$read = $_POST['sr44'];
			if($read == 'on'){
				$sn44 = 1;
			}
		}else{
			$sn44 = 0;
		}
		
		mysql_query("UPDATE submenu SET operator = $sn1 WHERE urutan = 1");
		mysql_query("UPDATE submenu SET operator = $sn2 WHERE urutan = 2");
		mysql_query("UPDATE submenu SET operator = $sn3 WHERE urutan = 3");
		mysql_query("UPDATE submenu SET operator = $sn4 WHERE urutan = 4");
		mysql_query("UPDATE submenu SET operator = $sn5 WHERE urutan = 5");
		mysql_query("UPDATE submenu SET operator = $sn6 WHERE urutan = 6");
		mysql_query("UPDATE submenu SET operator = $sn7 WHERE urutan = 7");
		mysql_query("UPDATE submenu SET operator = $sn8 WHERE urutan = 8");
		mysql_query("UPDATE submenu SET operator = $sn9 WHERE urutan = 9");
		mysql_query("UPDATE submenu SET operator = $sn10 WHERE urutan = 10");
		mysql_query("UPDATE submenu SET operator = $sn11 WHERE urutan = 11");
		mysql_query("UPDATE submenu SET operator = $sn12 WHERE urutan = 12");
		mysql_query("UPDATE submenu SET operator = $sn13 WHERE urutan = 13");
		mysql_query("UPDATE submenu SET operator = $sn14 WHERE urutan = 14");
		mysql_query("UPDATE submenu SET operator = $sn15 WHERE urutan = 15");
		mysql_query("UPDATE submenu SET operator = $sn16 WHERE urutan = 16");
		mysql_query("UPDATE submenu SET operator = $sn17 WHERE urutan = 17");
		mysql_query("UPDATE submenu SET operator = $sn18 WHERE urutan = 18");
		mysql_query("UPDATE submenu SET operator = $sn19 WHERE urutan = 19");
		mysql_query("UPDATE submenu SET operator = $sn20 WHERE urutan = 20");
		mysql_query("UPDATE submenu SET operator = $sn21 WHERE urutan = 21");
		mysql_query("UPDATE submenu SET operator = $sn22 WHERE urutan = 22");
		mysql_query("UPDATE submenu SET operator = $sn23 WHERE urutan = 23");
		mysql_query("UPDATE submenu SET operator = $sn24 WHERE urutan = 24");
		mysql_query("UPDATE submenu SET operator = $sn25 WHERE urutan = 25");
		mysql_query("UPDATE submenu SET operator = $sn26 WHERE urutan = 26");
		mysql_query("UPDATE submenu SET operator = $sn27 WHERE urutan = 27");
		mysql_query("UPDATE submenu SET operator = $sn28 WHERE urutan = 28");
		mysql_query("UPDATE submenu SET operator = $sn29 WHERE urutan = 29");
		mysql_query("UPDATE submenu SET operator = $sn30 WHERE urutan = 30");
		mysql_query("UPDATE submenu SET operator = $sn31 WHERE urutan = 31");
		mysql_query("UPDATE submenu SET operator = $sn32 WHERE urutan = 32");
		mysql_query("UPDATE submenu SET operator = $sn33 WHERE urutan = 33");
		mysql_query("UPDATE submenu SET operator = $sn34 WHERE urutan = 34");
		mysql_query("UPDATE submenu SET operator = $sn35 WHERE urutan = 35");
		mysql_query("UPDATE submenu SET operator = $sn36 WHERE urutan = 36");
		mysql_query("UPDATE submenu SET operator = $sn37 WHERE urutan = 37");
		mysql_query("UPDATE submenu SET operator = $sn38 WHERE urutan = 38");
		mysql_query("UPDATE submenu SET operator = $sn39 WHERE urutan = 39");
		mysql_query("UPDATE submenu SET operator = $sn40 WHERE urutan = 40");
		mysql_query("UPDATE submenu SET operator = $sn41 WHERE urutan = 41");
		mysql_query("UPDATE submenu SET operator = $sn42 WHERE urutan = 42");
		mysql_query("UPDATE submenu SET operator = $sn43 WHERE urutan = 43");
		//mysql_query("UPDATE submenu SET operator = $sn44 WHERE urutan = 44");
					
		echo '<meta http-equiv="refresh" content="0">';
	}	  
	  $ms1 = "SELECT * FROM mainmenu WHERE urutan = 1";
	  $mres1 = mysql_query($ms1);
	  $mr1 = mysql_fetch_array($mres1);
	  $_mck1 = ($mr1['operator'] == 0) ? '' : 'checked';
	  
	  $ms2 = "SELECT * FROM mainmenu WHERE urutan = 2";
	  $mres2 = mysql_query($ms2);
	  $mr2 = mysql_fetch_array($mres2);
	  $_mck2 = ($mr2['operator'] == 0) ? '' : 'checked';
	  
	  $ms3 = "SELECT * FROM mainmenu WHERE urutan = 3";
	  $mres3 = mysql_query($ms3);
	  $mr3 = mysql_fetch_array($mres3);
	  $_mck3 = ($mr3['operator'] == 0) ? '' : 'checked';
	  
	  $ms4 = "SELECT * FROM mainmenu WHERE urutan = 4";
	  $mres4 = mysql_query($ms4);
	  $mr4 = mysql_fetch_array($mres4);
	  $_mck4 = ($mr4['operator'] == 0) ? '' : 'checked';
	  
	  $ms5 = "SELECT * FROM mainmenu WHERE urutan = 5";
	  $mres5 = mysql_query($ms5);
	  $mr5 = mysql_fetch_array($mres5);
	  $_mck5 = ($mr5['operator'] == 0) ? '' : 'checked';
	  
	  $ms6 = "SELECT * FROM mainmenu WHERE urutan = 6";
	  $mres6 = mysql_query($ms6);
	  $mr6 = mysql_fetch_array($mres6);
	  $_mck6 = ($mr6['operator'] == 0) ? '' : 'checked';
	  
	  $ms7 = "SELECT * FROM mainmenu WHERE urutan = 7";
	  $mres7 = mysql_query($ms7);
	  $mr7 = mysql_fetch_array($mres7);
	  $_mck7 = ($mr7['operator'] == 0) ? '' : 'checked';
	  
	  $ms8 = "SELECT * FROM mainmenu WHERE urutan = 8";
	  $mres8 = mysql_query($ms8);
	  $mr8 = mysql_fetch_array($mres8);
	  $_mck8 = ($mr8['operator'] == 0) ? '' : 'checked';
	  
	  $ms9 = "SELECT * FROM mainmenu WHERE urutan = 9";
	  $mres9 = mysql_query($ms9);
	  $mr9 = mysql_fetch_array($mres9);
	  $_mck9 = ($mr9['operator'] == 0) ? '' : 'checked';
	  
	  $ms10 = "SELECT * FROM mainmenu WHERE urutan = 10";
	  $mres10 = mysql_query($ms10);
	  $mr10 = mysql_fetch_array($mres10);
	  $_mck10 = ($mr10['operator'] == 0) ? '' : 'checked';
	  
	  $ms11 = "SELECT * FROM mainmenu WHERE urutan = 11";
	  $mres11 = mysql_query($ms11);
	  $mr11 = mysql_fetch_array($mres11);
	  $_mck11 = ($mr11['operator'] == 0) ? '' : 'checked';
	
	  $ss1 = "SELECT * FROM submenu WHERE urutan = 1";
	  $sres1 = mysql_query($ss1);
	  $sr1 = mysql_fetch_array($sres1);
	  $_sck1 = ($sr1['operator'] == 0) ? '' : 'checked';
	  
	  $ss2 = "SELECT * FROM mainmenu WHERE urutan = 2";
	  $sres2 = mysql_query($ss2);
	  $sr2 = mysql_fetch_array($sres2);
	  $_sck2 = ($sr2['operator'] == 0) ? '' : 'checked';
	  
	  $ss3 = "SELECT * FROM mainmenu WHERE urutan = 3";
	  $sres3 = mysql_query($ss3);
	  $sr3 = mysql_fetch_array($sres3);
	  $_sck3 = ($sr3['operator'] == 0) ? '' : 'checked';
	  
	  $ss4 = "SELECT * FROM mainmenu WHERE urutan = 4";
	  $sres4 = mysql_query($ss4);
	  $sr4 = mysql_fetch_array($sres4);
	  $_sck4 = ($sr4['operator'] == 0) ? '' : 'checked';
	  
	  $ss5 = "SELECT * FROM mainmenu WHERE urutan = 5";
	  $sres5 = mysql_query($ss5);
	  $sr5 = mysql_fetch_array($sres5);
	  $_sck5 = ($sr5['operator'] == 0) ? '' : 'checked';
	  
	  $ss6 = "SELECT * FROM mainmenu WHERE urutan = 6";
	  $sres6 = mysql_query($ss6);
	  $sr6 = mysql_fetch_array($sres6);
	  $_sck6 = ($sr6['operator'] == 0) ? '' : 'checked';
	  
	  $ss7 = "SELECT * FROM mainmenu WHERE urutan = 7";
	  $sres7 = mysql_query($ss7);
	  $sr7 = mysql_fetch_array($sres7);
	  $_sck7 = ($sr7['operator'] == 0) ? '' : 'checked';
	  
	  $ss8 = "SELECT * FROM mainmenu WHERE urutan = 8";
	  $sres8 = mysql_query($ss8);
	  $sr8 = mysql_fetch_array($sres8);
	  $_sck8 = ($sr8['operator'] == 0) ? '' : 'checked';
	  
	  $ss9 = "SELECT * FROM mainmenu WHERE urutan = 9";
	  $sres9 = mysql_query($ss9);
	  $sr9 = mysql_fetch_array($sres9);
	  $_sck9 = ($sr9['operator'] == 0) ? '' : 'checked';
	  
	  $ss10 = "SELECT * FROM mainmenu WHERE urutan = 10";
	  $sres10 = mysql_query($ss10);
	  $sr10 = mysql_fetch_array($sres10);
	  $_sck10 = ($sr10['operator'] == 0) ? '' : 'checked';
	  
	  $ss11 = "SELECT * FROM mainmenu WHERE urutan = 11";
	  $sres11 = mysql_query($ss11);
	  $sr11 = mysql_fetch_array($sres11);
	  $_sck11 = ($sr11['operator'] == 0) ? '' : 'checked';
	  
	  $ss2 = "SELECT * FROM submenu WHERE urutan = 2";
	  $sres2 = mysql_query($ss2);
	  $sr2 = mysql_fetch_array($sres2);
	  $_sck2 = ($sr2['operator'] == 0) ? '' : 'checked';
	  
	  $ss3 = "SELECT * FROM submenu WHERE urutan = 3";
	  $sres3 = mysql_query($ss3);
	  $sr3 = mysql_fetch_array($sres3);
	  $_sck3 = ($sr3['operator'] == 0) ? '' : 'checked';
	  
	  $ss4 = "SELECT * FROM submenu WHERE urutan = 4";
	  $sres4 = mysql_query($ss4);
	  $sr4 = mysql_fetch_array($sres4);
	  $_sck4 = ($sr4['operator'] == 0) ? '' : 'checked';
	  
	  $ss5 = "SELECT * FROM submenu WHERE urutan = 5";
	  $sres5 = mysql_query($ss5);
	  $sr5 = mysql_fetch_array($sres5);
	  $_sck5 = ($sr5['operator'] == 0) ? '' : 'checked';
	  
	  $ss6 = "SELECT * FROM submenu WHERE urutan = 6";
	  $sres6 = mysql_query($ss6);
	  $sr6 = mysql_fetch_array($sres6);
	  $_sck6 = ($sr6['operator'] == 0) ? '' : 'checked';
	  
	  $ss7 = "SELECT * FROM submenu WHERE urutan = 7";
	  $sres7 = mysql_query($ss7);
	  $sr7 = mysql_fetch_array($sres7);
	  $_sck7 = ($sr7['operator'] == 0) ? '' : 'checked';
	  
	  $ss8 = "SELECT * FROM submenu WHERE urutan = 8";
	  $sres8 = mysql_query($ss8);
	  $sr8 = mysql_fetch_array($sres8);
	  $_sck8 = ($sr8['operator'] == 0) ? '' : 'checked';
	  
	  $ss9 = "SELECT * FROM submenu WHERE urutan = 9";
	  $sres9 = mysql_query($ss9);
	  $sr9 = mysql_fetch_array($sres9);
	  $_sck9 = ($sr9['operator'] == 0) ? '' : 'checked';
	  
	  $ss10 = "SELECT * FROM submenu WHERE urutan = 10";
	  $sres10 = mysql_query($ss10);
	  $sr10 = mysql_fetch_array($sres10);
	  $_sck10 = ($sr10['operator'] == 0) ? '' : 'checked';
	  
	  $ss11 = "SELECT * FROM submenu WHERE urutan = 11";
	  $sres11 = mysql_query($ss11);
	  $sr11 = mysql_fetch_array($sres11);
	  $_sck11 = ($sr11['operator'] == 0) ? '' : 'checked';
	  
	  $ss12 = "SELECT * FROM submenu WHERE urutan = 12";
	  $sres12 = mysql_query($ss12);
	  $sr12 = mysql_fetch_array($sres12);
	  $_sck12 = ($sr12['operator'] == 0) ? '' : 'checked';
	  
	  $ss13 = "SELECT * FROM submenu WHERE urutan = 13";
	  $sres13 = mysql_query($ss13);
	  $sr13 = mysql_fetch_array($sres13);
	  $_sck13 = ($sr13['operator'] == 0) ? '' : 'checked';
	  
	  $ss14 = "SELECT * FROM submenu WHERE urutan = 14";
	  $sres14 = mysql_query($ss14);
	  $sr14 = mysql_fetch_array($sres14);
	  $_sck14 = ($sr14['operator'] == 0) ? '' : 'checked';
	  
	  $ss15 = "SELECT * FROM submenu WHERE urutan = 15";
	  $sres15 = mysql_query($ss15);
	  $sr15 = mysql_fetch_array($sres15);
	  $_sck15 = ($sr15['operator'] == 0) ? '' : 'checked';
	  
	  $ss16 = "SELECT * FROM submenu WHERE urutan = 16";
	  $sres16 = mysql_query($ss16);
	  $sr16 = mysql_fetch_array($sres16);
	  $_sck16 = ($sr16['operator'] == 0) ? '' : 'checked';
	  
	  $ss17 = "SELECT * FROM submenu WHERE urutan = 17";
	  $sres17 = mysql_query($ss17);
	  $sr17 = mysql_fetch_array($sres17);
	  $_sck17 = ($sr17['operator'] == 0) ? '' : 'checked';
	  
	  $ss18 = "SELECT * FROM submenu WHERE urutan = 18";
	  $sres18 = mysql_query($ss18);
	  $sr18 = mysql_fetch_array($sres18);
	  $_sck18 = ($sr18['operator'] == 0) ? '' : 'checked';
	  
	  $ss19 = "SELECT * FROM submenu WHERE urutan = 19";
	  $sres19 = mysql_query($ss19);
	  $sr19 = mysql_fetch_array($sres19);
	  $_sck19 = ($sr19['operator'] == 0) ? '' : 'checked';
	  
	  $ss20 = "SELECT * FROM submenu WHERE urutan = 20";
	  $sres20 = mysql_query($ss20);
	  $sr20 = mysql_fetch_array($sres20);
	  $_sck20 = ($sr20['operator'] == 0) ? '' : 'checked';
	  
	  $ss21 = "SELECT * FROM submenu WHERE urutan = 21";
	  $sres21 = mysql_query($ss21);
	  $sr21 = mysql_fetch_array($sres21);
	  $_sck21 = ($sr21['operator'] == 0) ? '' : 'checked';
	  
	  $ss22 = "SELECT * FROM submenu WHERE urutan = 22";
	  $sres22 = mysql_query($ss22);
	  $sr22 = mysql_fetch_array($sres22);
	  $_sck22 = ($sr22['operator'] == 0) ? '' : 'checked';
	  
	  $ss23 = "SELECT * FROM submenu WHERE urutan = 23";
	  $sres23 = mysql_query($ss23);
	  $sr23 = mysql_fetch_array($sres23);
	  $_sck23 = ($sr23['operator'] == 0) ? '' : 'checked';
	  
	  $ss24 = "SELECT * FROM submenu WHERE urutan = 24";
	  $sres24 = mysql_query($ss24);
	  $sr24 = mysql_fetch_array($sres24);
	  $_sck24 = ($sr24['operator'] == 0) ? '' : 'checked';
	  
	  $ss25 = "SELECT * FROM submenu WHERE urutan = 25";
	  $sres25 = mysql_query($ss25);
	  $sr25 = mysql_fetch_array($sres25);
	  $_sck25 = ($sr25['operator'] == 0) ? '' : 'checked';
	  
	  $ss26 = "SELECT * FROM submenu WHERE urutan = 26";
	  $sres26 = mysql_query($ss26);
	  $sr26 = mysql_fetch_array($sres26);
	  $_sck26 = ($sr26['operator'] == 0) ? '' : 'checked';
	  
	  $ss27 = "SELECT * FROM submenu WHERE urutan = 27";
	  $sres27 = mysql_query($ss27);
	  $sr27 = mysql_fetch_array($sres27);
	  $_sck27 = ($sr27['operator'] == 0) ? '' : 'checked';
	  
	  $ss28 = "SELECT * FROM submenu WHERE urutan = 28";
	  $sres28 = mysql_query($ss28);
	  $sr28 = mysql_fetch_array($sres28);
	  $_sck28 = ($sr28['operator'] == 0) ? '' : 'checked';
	  
	  $ss29 = "SELECT * FROM submenu WHERE urutan = 29";
	  $sres29 = mysql_query($ss29);
	  $sr29 = mysql_fetch_array($sres29);
	  $_sck29 = ($sr29['operator'] == 0) ? '' : 'checked';
	  
	  $ss30 = "SELECT * FROM submenu WHERE urutan = 30";
	  $sres30 = mysql_query($ss30);
	  $sr30 = mysql_fetch_array($sres30);
	  $_sck30 = ($sr30['operator'] == 0) ? '' : 'checked';
	  
	  $ss31 = "SELECT * FROM submenu WHERE urutan = 31";
	  $sres31 = mysql_query($ss31);
	  $sr31 = mysql_fetch_array($sres31);
	  $_sck31 = ($sr31['operator'] == 0) ? '' : 'checked';
	  
	  $ss32 = "SELECT * FROM submenu WHERE urutan = 32";
	  $sres32 = mysql_query($ss32);
	  $sr32 = mysql_fetch_array($sres32);
	  $_sck32 = ($sr32['operator'] == 0) ? '' : 'checked';
	  
	  $ss33 = "SELECT * FROM submenu WHERE urutan = 33";
	  $sres33 = mysql_query($ss33);
	  $sr33 = mysql_fetch_array($sres33);
	  $_sck33 = ($sr33['operator'] == 0) ? '' : 'checked';
	  
	  $ss34 = "SELECT * FROM submenu WHERE urutan = 34";
	  $sres34 = mysql_query($ss34);
	  $sr34 = mysql_fetch_array($sres34);
	  $_sck34 = ($sr34['operator'] == 0) ? '' : 'checked';
	  
	  $ss35 = "SELECT * FROM submenu WHERE urutan = 35";
	  $sres35 = mysql_query($ss35);
	  $sr35 = mysql_fetch_array($sres35);
	  $_sck35 = ($sr35['operator'] == 0) ? '' : 'checked';
	  
	  $ss36 = "SELECT * FROM submenu WHERE urutan = 36";
	  $sres36 = mysql_query($ss36);
	  $sr36 = mysql_fetch_array($sres36);
	  $_sck36 = ($sr36['operator'] == 0) ? '' : 'checked';
	  
	  $ss37 = "SELECT * FROM submenu WHERE urutan = 37";
	  $sres37 = mysql_query($ss37);
	  $sr37 = mysql_fetch_array($sres37);
	  $_sck37 = ($sr37['operator'] == 0) ? '' : 'checked';
	  
	  $ss38 = "SELECT * FROM submenu WHERE urutan = 38";
	  $sres38 = mysql_query($ss38);
	  $sr38 = mysql_fetch_array($sres38);
	  $_sck38 = ($sr38['operator'] == 0) ? '' : 'checked';
	  
	  $ss39 = "SELECT * FROM submenu WHERE urutan = 39";
	  $sres39 = mysql_query($ss39);
	  $sr39 = mysql_fetch_array($sres39);
	  $_sck39 = ($sr39['operator'] == 0) ? '' : 'checked';
	  
	  $ss40 = "SELECT * FROM submenu WHERE urutan = 40";
	  $sres40 = mysql_query($ss40);
	  $sr40 = mysql_fetch_array($sres40);
	  $_sck40 = ($sr40['operator'] == 0) ? '' : 'checked';
	  
	  $ss41 = "SELECT * FROM submenu WHERE urutan = 41";
	  $sres41 = mysql_query($ss41);
	  $sr41 = mysql_fetch_array($sres41);
	  $_sck41 = ($sr41['operator'] == 0) ? '' : 'checked';
	  
	  $ss42 = "SELECT * FROM submenu WHERE urutan = 42";
	  $sres42 = mysql_query($ss42);
	  $sr42 = mysql_fetch_array($sres42);
	  $_sck42 = ($sr42['operator'] == 0) ? '' : 'checked';
	  
	  $ss43 = "SELECT * FROM submenu WHERE urutan = 43";
	  $sres43 = mysql_query($ss43);
	  $sr43 = mysql_fetch_array($sres43);
	  $_sck43 = ($sr43['operator'] == 0) ? '' : 'checked';
	  
	  $ss44 = "SELECT * FROM submenu WHERE urutan = 44";
	  $sres44 = mysql_query($ss44);
	  $sr44 = mysql_fetch_array($sres44);
	  $_sck44 = ($sr44['operator'] == 0) ? '' : 'checked';
	  
  }
?>
<table>
<tr>
<td>
<?php
echo "  <ul id='tree1'>
			<li><input type='checkbox' name=mr1 $_mck1>$mr1[nama_menu]
			
			<li><input type='checkbox' name=mr5 $_mck5>$mr5[nama_menu]
			<ul>
				<li><input type='checkbox' name=sr7 $_sck7> $sr7[nama_sub]</li>
				<li><input type='checkbox' name=sr8 $_sck8> $sr8[nama_sub]</li>
				<li><input type='checkbox' name=sr9 $_sck9> $sr9[nama_sub]</li>
				<li><input type='checkbox' name=sr10 $_sck10> $sr10[nama_sub]</li>
			</ul>
			<li><input type='checkbox' name=mr9 $_mck9>$mr9[nama_menu]
			<ul>
				<li><input type='checkbox' name=sr26 $_sck26> $sr26[nama_sub]</li>
				<li><input type='checkbox' name=sr27 $_sck27> $sr27[nama_sub]</li>
				<li><input type='checkbox' name=sr28 $_sck28> $sr28[nama_sub]</li>
				<li><input type='checkbox' name=sr29 $_sck29> $sr29[nama_sub]</li>
				<li><input type='checkbox' name=sr38 $_sck38> $sr38[nama_sub]</li>
				<li><input type='checkbox' name=sr39 $_sck39> $sr39[nama_sub]</li>
				<li><input type='checkbox' name=sr42 $_sck42> $sr42[nama_sub]</li>
			</ul>
		</ul>";
?></td>
<td><?php
echo "  <ul id='tree2'>
			<li><input type='checkbox' name=mr2 $_mck2>$mr2[nama_menu]
			<ul>
				<li><input type='checkbox' name=sr1 $_sck1> $sr1[nama_sub]</li>
				<li><input type='checkbox' name=sr2 $_sck2> $sr2[nama_sub]</li>
				<li><input type='checkbox' name=sr30 $_sck30> $sr30[nama_sub]</li>
				
			</ul>
			<li><input type='checkbox' name=mr6 $_mck6>$mr6[nama_menu]
			<ul>
				<li><input type='checkbox' name=sr13 $_sck13> $sr13[nama_sub]</li>
				<li><input type='checkbox' name=sr14 $_sck14> $sr14[nama_sub]</li>
				<li><input type='checkbox' name=sr15 $_sck15> $sr15[nama_sub]</li>
				<li><input type='checkbox' name=sr16 $_sck16> $sr16[nama_sub]</li>
				<li><input type='checkbox' name=sr17 $_sck17> $sr17[nama_sub]</li>
				<li><input type='checkbox' name=sr18 $_sck18> $sr18[nama_sub]</li>
			</ul>
			
		</ul>";
?></td>
<td><?php
echo "  <ul id='tree3'>
			<li><input type='checkbox' name=mr3 $_mck3>$mr3[nama_menu]
			<ul>
				<li><input type='checkbox' name=sr3 $_sck3> $sr3[nama_sub]</li>
				<li><input type='checkbox' name=sr4 $_sck4> $sr4[nama_sub]</li>
				<li><input type='checkbox' name=sr5 $_sck5> $sr5[nama_sub]</li>
				<li><input type='checkbox' name=sr6 $_sck6> $sr6[nama_sub]</li>
			</ul>
			<li><input type='checkbox' name=mr7 $_mck7>$mr7[nama_menu]
			<ul>
				<li><input type='checkbox' name=sr19 $_sck19> $sr19[nama_sub]</li>
				<li><input type='checkbox' name=sr20 $_sck20> $sr20[nama_sub]</li>
				<li><input type='checkbox' name=sr21 $_sck21> $sr21[nama_sub]</li>
				<li><input type='checkbox' name=sr22 $_sck22> $sr22[nama_sub]</li>
				<li><input type='checkbox' name=sr23 $_sck23> $sr23[nama_sub]</li>
				<li><input type='checkbox' name=sr24 $_sck24> $sr24[nama_sub]</li>
				<li><input type='checkbox' name=sr25 $_sck25> $sr25[nama_sub]</li>
			</ul>
			
		</ul>";
?></td>
<td><?php
echo "  <ul id='tree4'>
			<li><input type='checkbox' name=mr4 $_mck4>$mr4[nama_menu]
			<ul>
				<li><input type='checkbox' name=sr43 $_sck43> $sr43[nama_sub]</li>
			</ul>
			<li><input type='checkbox' name=mr8 $_mck8>$mr8[nama_menu]
			<ul>
				<li><input type='checkbox' name=sr31 $_sck31> $sr31[nama_sub]</li>
				<li><input type='checkbox' name=sr32 $_sck32> $sr32[nama_sub]</li>
				<li><input type='checkbox' name=sr33 $_sck33> $sr33[nama_sub]</li>
				<li><input type='checkbox' name=sr34 $_sck34> $sr34[nama_sub]</li>
				<li><input type='checkbox' name=sr35 $_sck35> $sr35[nama_sub]</li>
				<li><input type='checkbox' name=sr36 $_sck36> $sr36[nama_sub]</li>
				<li><input type='checkbox' name=sr37 $_sck37> $sr37[nama_sub]</li>
			</ul>			
		</ul>";
?></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td><input type="submit" id="button-akses" name="submit" value="Save">
<?php echo form_button(array('id' => 'button-cancel', 'content' => 'Kembali', 'onClick' => "location.href='".site_url()."user'" ));?></td>
</tr>
</table>
   
</form>

<script type='text/javascript'>
	//Validasi di client
	$(document).ready(function()
	{
		$('#user_form').validate({
			errorLabelContainer: "#error",
			wrapper: "li",
			rules: 
			{
				fname: "required lettersonly",
				lname: "required lettersonly",
				username: "required alphanumeric",
				<?php if($act=='add') echo 'password: "required",'; ?>
				cpassword: {
					equalTo: "#password"
				}
			}
		});
	});
</script>
